mooz / xkeysnail

Yet another keyboard remapping tool for X environment
891 stars 112 forks source link

cant map any key to Alt-tab #80

Closed dulm closed 3 years ago

dulm commented 4 years ago

version 0.2

add print to debug:

def send_key_action(key, action):
    print(key, action)
    update_modifier_key_pressed(key, action)
    update_pressed_keys(key, action)
    _uinput.write(ecodes.EV_KEY, key, action)
    send_sync()

linux mint 19.3 use Alt-tab to switch window.

map Shift-h to Alt-tab use K("Shift-h"): K("Alt-tab"),, not work.

Key.LEFT_SHIFT Action.PRESS
WM_CLASS 'jetbrains-pycharm' | active keymaps = [global, jetbrains-pycharm]
LShift-H
Key.LEFT_SHIFT Action.RELEASE

Key.LEFT_ALT Action.PRESS
Key.TAB Action.PRESS
Key.TAB Action.RELEASE
Key.LEFT_ALT Action.RELEASE

Key.LEFT_SHIFT Action.PRESS
Key.LEFT_SHIFT Action.RELEASE
rbreaves commented 4 years ago

This would be due to a commit I had submitted and merged into xkeysnail. I had not expected a keymap quite like this for app switching to be honest. I only expected Shift to be used as a temporary means to reverse a given Alt-Tab remap.

Seeing that was a bad assumption to make I will see about not ignoring Shift unless it is the singular modifier being mapped for the action.

Additionally the reason for the change was to improve the ability of mapping to Alt-Tab in general, the way it worked before wouldn't have allowed for the Alt-Tab menu to stay present because it was only quickly emitting the keymap versus keeping the modifier key held with the original. Unless the shift modifier worked differently than the others.

rbreaves commented 4 years ago

This issue is now fixed in the current pull request #76 with commit https://github.com/mooz/xkeysnail/pull/76/commits/113cc1a55f1c890aa4c711111b33d855e93034fd

I made other fixes for the patch and due to them this ignoring of the shift modifier is not needed.