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

Won't hold down a key (only single click) #85

Open
Combinacijus opened this issue Jun 21, 2020 · 0 comments
Open

Won't hold down a key (only single click) #85

Combinacijus opened this issue Jun 21, 2020 · 0 comments

Comments

@Combinacijus
Copy link

For example when I map shift to a button (for resizing brush in Krita) it won't work because it only clicks once and do not hold. This happens because how python script call xdotool key instead of xdotool keydown (sequence come from config file) here:

cmd = "xdotool {}".format(sequence)

when config looks like this:

[menu_4b_simple]
b0 = key ctrl+z        # undo (krita)
b1 = key shift          # resize brush (krita)
...

Workaround
In config change key to keydown for button which need hold

[menu_4b_simple]
b0 = key ctrl+z          # undo (krita)
b1 = keydown shift   # resize brush (krita)
...

But now it won't release so we need to modify driver to release that button in this case shift (couldn't find a general solution). I did it by calling xdotool keyup in this case using keypress function gives same result. So I added else statement for this if:

if BUTTON_VAL > 0: # 0 means release

if BUTTON_VAL > 0:  # 0 means release
  # Unchanged
   ...
else:
   # HERE RELEASE ALL KEYS
   keypress("Shift up", "keyup shift")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant