text: Title: Key capture seems broken on Ubuntu 22.04
  Body: ### Has this issue already been reported?
  
  - [X] I have searched through the existing issues.
  
  ### Is this a question rather than an issue?
  
  - [X] This is not a question.
  
  ### What type of issue is this?
  
  Bug
  
  ### Which Linux distribution did you use?
  
  I've been using AutoKey on Ubuntu 20.04 LTS for months now with this setup and it worked perfectly. Since updating to 22.04 LTS AutoKey no longer captures keys properly.
  
  ### Which AutoKey GUI did you use?
  
  GTK
  
  ### Which AutoKey version did you use?
  
  Autokey-gtk 0.95.10 from apt.
  
  ### How did you install AutoKey?
  
  Distro's repository, didn't change anything during upgrade to 22.04LTS.
  
  ### Can you briefly describe the issue?
  
  AutoKey no longer seems to capture keys reliably.
  
  My old scripts are set up like: ALT+A = ä, ALT+SHIFT+A = Ä, ALT+S=ß etc. This worked perfectly on 20.04LTS across multiple machines.
  
  Since the update to 22.04LTS, these scripts only work sporadically, and only in some apps.
  
  Firefox (Snap):
  ALT+A works in Firefox if pressed slowly.
  ALT+SHIFT+A produces the same output as ALT+A in Firefox if pressed slowly.
  If combination is pressed quickly while typing a word, such as "ändern", Firefox will capture the release of the ALT key and send the letters "ndern" to the menu, triggering EDIT=>SETTINGS.
  
  Geany (text editor): ALT key is immediately captured by the menu
  Gedit (text editor): ALT key is immediately captured by the menu
  
  Setting hotkeys in AutoKey-GTK itself also doesn't seem to work any more. If I click "Press to Set" the program no longer recognizes any keypresses, hanging on "press a key..." indefinitely.
  
  ![image](https://user-images.githubusercontent.com/409535/187735841-e2ee339f-d941-40f9-9049-2607c371658b.png)
  
  
  My scripts are set up as follows:
  ![image](https://user-images.githubusercontent.com/409535/187736163-cbfbd11f-b817-4089-9de1-9cd754931a5b.png)
  
  
  ### Can the issue be reproduced?
  
  Sometimes
  
  ### What are the steps to reproduce the issue?
  
  I've reproduced this on two different machines, both of which were upgraded from 20.04LTS to 22.04LTS and run the same script files.
  
  ### What should have happened?
  
  Same perfect performance as on 20.04LTS
  
  ### What actually happened?
  
  See issue description. AutoKey seems to no longer be capturing the keys properly, or rather the foreground app is grabbing them before AutoKey has a chance to do so.
  
  ### Do you have screenshots?
  
  _No response_
  
  ### Can you provide the output of the AutoKey command?
  
  _No response_
  
  ### Anything else?
  
  _No response_