Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoKey detects invalid keys when setting up hotkeys #936

Open
5 of 16 tasks
KOT040188 opened this issue Feb 9, 2024 · 4 comments
Open
5 of 16 tasks

AutoKey detects invalid keys when setting up hotkeys #936

KOT040188 opened this issue Feb 9, 2024 · 4 comments

Comments

@KOT040188
Copy link

AutoKey is a Xorg application and will not function in a Wayland session. Do you use Xorg (X11) or Wayland?

Xorg

Has this issue already been reported?

  • I have searched through the existing issues.

Is this a question rather than an issue?

  • This is not a question.

What type of issue is this?

Bug

Choose one or more terms that describe this issue:

  • autokey triggers
  • autokey-gtk
  • autokey-qt
  • beta
  • bug
  • critical
  • development
  • documentation
  • enhancement
  • installation/configuration
  • phrase expansion
  • scripting
  • technical debt
  • user interface

Other terms that describe this issue if not provided above:

hotkeys

Which Linux distribution did you use?

Opensuse Tumbleweed

Which AutoKey GUI did you use?

Qt

Which AutoKey version did you use?

0.95.9

How did you install AutoKey?

From the official repository

Can you briefly describe the issue?

When setting hotkeys, autokey detects letters from a layout unknown to me. I don't have this keyboard layout. I turn on the English layout, and autokey writes letters from a language I don’t understand.

Can the issue be reproduced?

None

What are the steps to reproduce the issue?

No response

What should have happened?

When the English layout is installed, autokey should record hotkeys with English letters

What actually happened?

autokey records hotkeys from a keyboard layout unknown to me (language unknown to me)

Do you have screenshots?

https://imgur.com/a/SyJniyX I pressed ctrl+d, but got an unknown symbol instead of d

Can you provide the output of the AutoKey command?

kot@192:~$ autokey-qt
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 673, sequence_number = 33, major_opcode = 33, minor_opcode = 0
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 673, sequence_number = 34, major_opcode = 33, minor_opcode = 0
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 673, sequence_number = 35, major_opcode = 33, minor_opcode = 0
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 673, sequence_number = 36, major_opcode = 33, minor_opcode = 0

kot@192:~$ autokey-qt --verbose
2024-02-09 23:06:13,751 INFO - root - Initialising application
2024-02-09 23:06:13,777 INFO - root - Initialise global hotkeys
2024-02-09 23:06:13,777 INFO - config-manager - Loading config from existing file: /home/kot/.config/autokey/autokey.json
2024-02-09 23:06:13,777 DEBUG - config-manager - Loading folder at '/home/kot/.config/autokey/data/Sample Scripts'
2024-02-09 23:06:13,778 DEBUG - config-manager - Loading folder at '/home/kot/.config/autokey/data/My Phrases'
2024-02-09 23:06:13,778 INFO - config-manager - Configuration changed - rebuilding in-memory structures
2024-02-09 23:06:13,778 DEBUG - inotify - Adding watch for /home/kot/.config/autokey/data/Sample Scripts
2024-02-09 23:06:13,778 DEBUG - inotify - Adding watch for /home/kot/.config/autokey/data/My Phrases
2024-02-09 23:06:13,779 DEBUG - inotify - Adding watch for /home/kot/.config/autokey/data/My Phrases/Addresses
2024-02-09 23:06:13,779 INFO - config-manager - Successfully loaded configuration
2024-02-09 23:06:13,779 DEBUG - inotify - Adding watch for /home/kot/.config/autokey/data
2024-02-09 23:06:13,779 DEBUG - inotify - Adding watch for /home/kot/.config/autokey
2024-02-09 23:06:13,779 DEBUG - config-manager - Global settings: {'isFirstRun': False, 'serviceRunning': True, 'menuTakesFocus': False, 'showTrayIcon': True, 'sortByUsageCount': True, 'promptToSave': False, 'enableQT4Workaround': False, 'interfaceType': 'XRecord', 'undoUsingBackspace': True, 'windowDefaultSize': [600, 400], 'hPanePosition': 260, 'columnWidths': [178, 41, 100], 'showToolbar': True, 'notificationIcon': 'autokey-status', 'workAroundApps': '.*VirtualBox.*|krdc.Krdc', 'triggerItemByInitial': False, 'scriptGlobals': {}}
2024-02-09 23:06:13,779 INFO - service - Starting service
2024-02-09 23:06:13,838 DEBUG - interface - Modifier masks: {<Key.SHIFT: '<shift>'>: 1, <Key.CAPSLOCK: '<capslock>'>: 2, <Key.CONTROL: '<ctrl>'>: 4, <Key.ALT: '<alt>'>: 8, <Key.ALT_GR: '<alt_gr>'>: 128, <Key.SUPER: '<super>'>: 64, <Key.HYPER: '<hyper>'>: 64, <Key.META: '<meta>'>: 8, <Key.NUMLOCK: '<numlock>'>: 16}
2024-02-09 23:06:13,862 DEBUG - interface - Alt-Grid: XK_Alt_R, 65514
2024-02-09 23:06:13,862 DEBUG - interface - X Server Keymap, listing unmapped keys.
2024-02-09 23:06:13,863 DEBUG - iomediator - Set modifier Key.CAPSLOCK to False
2024-02-09 23:06:13,863 DEBUG - iomediator - Set modifier Key.NUMLOCK to False
2024-02-09 23:06:13,863 DEBUG - interface - Grabbing hotkey: ['<super>'] 'k'
2024-02-09 23:06:13,863 DEBUG - interface - Grabbing hotkey: ['<shift>', '<super>'] 'k'
2024-02-09 23:06:13,863 DEBUG - interface - Grabbing hotkey: ['<ctrl>'] '<f7>'
2024-02-09 23:06:13,864 DEBUG - interface - __flushEvents: Entering event loop.
2024-02-09 23:06:13,864 INFO - iomediator - Created IoMediator instance, current interface is: <XRecordInterface(XInterface-thread, initial daemon)>
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 673, sequence_number = 33, major_opcode = 33, minor_opcode = 0
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 673, sequence_number = 34, major_opcode = 33, minor_opcode = 0
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 673, sequence_number = 35, major_opcode = 33, minor_opcode = 0
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 673, sequence_number = 36, major_opcode = 33, minor_opcode = 0
2024-02-09 23:06:13,869 INFO - interface - XRecord interface thread starting
2024-02-09 23:06:13,869 INFO - service - Service now marked as running
2024-02-09 23:06:13,870 DEBUG - Qt-GUI.System-tray-notifier - Creating system tray icon notifier.
2024-02-09 23:06:13,871 INFO - Qt-GUI.System-tray-notifier - Creating static context menu actions.
2024-02-09 23:06:13,872 DEBUG - Qt-GUI.System-tray-notifier - Show tray icon enabled in settings: True
2024-02-09 23:06:13,872 INFO - Qt-GUI.System-tray-notifier - Rebuilding model item actions, adding all items marked for access through the tray icon.
2024-02-09 23:06:13,873 DEBUG - phrase-menu - Sorting phrase menu by usage count
2024-02-09 23:06:13,873 DEBUG - Qt-GUI.System-tray-notifier - About to show the tray icon.
2024-02-09 23:06:13,876 INFO - Qt-GUI.System-tray-notifier - System tray icon notifier created.
2024-02-09 23:06:13,876 DEBUG - Qt-GUI.CentralWidget - CentralWidget instance created.
2024-02-09 23:06:13,999 DEBUG - Qt-GUI.Hotkey Settings Dialog - Loaded item folder 'My Phrases', key: <f7>, modifiers: ['<ctrl>']
2024-02-09 23:06:14,001 DEBUG - Qt-GUI.Hotkey Settings Dialog - Loaded item folder 'My Phrases', key: <f7>, modifiers: ['<ctrl>']
2024-02-09 23:06:14,001 DEBUG - root - Creating DBus service
2024-02-09 23:06:14,002 DEBUG - root - Service created
2024-02-09 23:06:30,272 DEBUG - Qt-GUI.System-tray-notifier - Triggered system tray icon with reason: 3
2024-02-09 23:06:30,272 INFO - root - Displaying configuration window
2024-02-09 23:06:42,383 DEBUG - iomediator - Key.ALT pressed
2024-02-09 23:06:42,895 DEBUG - service - Raw key: 'ۛ', modifiers: [<Key.ALT: '<alt>'>], Key: ۛ
2024-02-09 23:06:42,895 DEBUG - service - Window visible title: 'Set Hotkey', Window class: 'autokey-qt.autokey-qt'
2024-02-09 23:06:43,101 DEBUG - iomediator - Key.ALT released
2024-02-09 23:06:45,259 DEBUG - Qt-GUI.Hotkey Settings Dialog - User starts to record a key combination.
2024-02-09 23:06:45,909 DEBUG - iomediator - Key.ALT pressed
2024-02-09 23:06:46,271 DEBUG - service - Raw key: 'ۛ', modifiers: [<Key.ALT: '<alt>'>], Key: ۛ
2024-02-09 23:06:46,271 DEBUG - service - Window visible title: 'Set Hotkey', Window class: 'autokey-qt.autokey-qt'
2024-02-09 23:06:46,510 DEBUG - iomediator - Key.ALT released

Anything else?

No response

@josephj11
Copy link
Contributor

Welcome to the AutoKey community, @KOT040188 !

Not sure exactly what's going on here, but there are some general considerations that might help.

TL;DR: Make sure you're using your primary keyboard layout and upgrade to our current release which is several years newer than the one you are running.

Doing these might not fix all the problems, but it will probably help.
I know a boatload of bug fixes were related to multibyte character sets which may be impacting your current situation.

Opensuse Tumbleweed appears to be quite recent. I'm surprised they have such an old version of AutoKey in their repositories. Even 0.95.10 is a lot better although it is also quite old.

First, I notice that you are not running 0.96.0, our current release. This release contains a lot of bug fixes and a few new features. We highly encourage users to upgrade as soon as possible. You can find it here and instructions are here.

The installation is pretty easy to do.

I turn on the English layout is concerning. AutoKey has a known limitation that it only sees and respects the primary keyboard layout. If the English layout is not the primary layout, bad things like you are experiencing happen. I believe this is an upstream problem, but I know it has never been addressed. If you can make the primary layout the one you need to use with AutoKey, things should be better.

I'm guessing that you have used AutoKey before and are trying to use an existing set of actions (phrases and scripts) in a new way or on a new install. I say this because I see a bunch of xlib errors in the trace. Those are usually quite difficult to interpret, but they often seem to occur when AutoKey attempts to grab hotkeys from the system which have already been grabbed by the desktop or by other applications. This might possibly be caused by the keyboard layout problem. IDK how all that works internally in AutoKey.

I am a native English speaker, so I don't have any experience with other layouts and locales.
I do remember having to use the locale command long ago to set the locale to C for the most unmodified experience. See this and this which may or may not help.

See if any of this helps and maybe we can find some next steps to try.

@KOT040188
Copy link
Author

I installed autokey a long time ago, but launched it today for the first time. There was no time before. I'll try installing a more recent version of autokey and post the result.

@josephj11
Copy link
Contributor

I think you'll like it once you get it working. It's like a TV remote control. Long ago and far away, nobody felt there was any need for a remote control. You just got up and turned the knobs. Now, people can't imagine doing without one.

Be sure to check out our wiki. It has a bunch of useful articles and a lot of example scripts.

@KOT040188
Copy link
Author

I installed version 0.96.0, but nothing changed. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants