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

Trigger scripts instead of Keys #76

Open
magdesign opened this issue Apr 14, 2024 · 6 comments
Open

Trigger scripts instead of Keys #76

magdesign opened this issue Apr 14, 2024 · 6 comments

Comments

@magdesign
Copy link

magdesign commented Apr 14, 2024

Working on a custom layout where i add a button for speech-to-text input and a button to enable touchpad simulation (to show a mouse pointer) for pmos, sxmo, linuxmobile.

but i am not quite sure how i could define to trigger an action/script instead of a keypress. any hints are very welcome 😘

(i promise to document it here)

@proycon
Copy link
Collaborator

proycon commented Apr 14, 2024 via email

@magdesign
Copy link
Author

thanks for this detailed replay !
i started solving it with key combos (see link above)... and will later dig into your second solution (when i can use a bigger screen somewhere 😅) .

@magdesign
Copy link
Author

magdesign commented Apr 15, 2024

there are so many keycombos used in the system and i am struggling making long combos like:
{"󰍬", "󰍬", 1.0, Code, KEY_P, Shift, AltGr, KEY_DOT},

this will just type a 0

or:
{"󰍬", "󰍬", 1.0, Code, Mod, Ctrl, Shift, KEY_DOT}

will just type a ! instead of simulating the full combo

so keycombos are not really a safe way to go....

@proycon
Copy link
Collaborator

proycon commented Apr 15, 2024

Sorry, I may have set you on the wrong foot by saying "key combo", you can't currently configure a single key to output an actual sequence of keys. Code emits a single keycode with optionally a forced modifier (ctrl, altgr, shift, etc). So the 'key combo' is limited to such simple combinations. This for instance will emit super+p (you can't add extra fields like you did above):

{"󰍬", "󰍬", 1.0, Code, KEY_P, 0, Super},
                                ^---- code_mod    
                      ^------ code

@proycon
Copy link
Collaborator

proycon commented Apr 15, 2024

If you want multiple modifiers, I think you can add them together with bitwise OR: Super | AltGr

@magdesign
Copy link
Author

i've just overwritten some regular keybindings for now, but will try your idea.

btw.
if there ever will be a script implementation, it would also be nice to have some kind of pressed/released trigger. so we could run a script when pressed and when released it would stop or run a kill script..

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

2 participants