timothycrosley / streamdeck-ui

A Linux compatible UI for the Elgato Stream Deck.
https://timothycrosley.github.io/streamdeck-ui/
MIT License
1.14k stars 242 forks source link

[resolved] cannot send / from Num pad #207

Closed karls0 closed 2 years ago

karls0 commented 2 years ago

Hi, first thank you for your fantastic software. I really like it. I use my Stream Deck for daVinci Resolve and needed to send Ctrl+plus and "Ctrl+minus". After some trying I found out that Ctrl+- worked. For my other problem, sending "/" and "Alt+/", I don't find a solution. Both commands only work with the "/" on the Num-pad and not with Shift+7. From the "keyboard customisation" in Resolve I got the idea of using two plus-signs, like "Num++/" and "Alt+Num++/". But this doesn't work either. I tried to look into the source according to "The standard list of keys can be found at the source." But I am not good enough at python to find what I need.

Anyone any ideas to resolve this.

Thanks in advance, Karl

PS: Maybe you could extend the examples of keys a bit or point to a source for key-names, that is easier to understand :-)

dodgyrabbit commented 2 years ago

Hi @karls0 ,

Glad you find the software useful. I read your description a few times - but it's not clear to me what exactly the problem is.

I use my Stream Deck for daVinci Resolve and needed to send Ctrl+plus and "Ctrl+minus". After some trying I found out that Ctrl+- worked.

Because + is used in the definition of the Press Keys feature, we substitute it with the word plus. So, if you want to send ctrl combined with + the you should use ctrl + plus. However, since - is not used for defining your key combination, you can use ctrl + - to combine ctrl and -. ctrl + minus is not a valid configuration.

For my other problem, sending "/" and "Alt+/", I don't find a solution. Both commands only work with the "/" on the Num-pad and not with Shift+7.

Can you elaborate here. Different keyboards have different layouts. For example, Shift+7 is & on my keyboard. I don't believe there should be a difference between the / on the numpad vs the / that you find elsewhere (on my keyboard, Shift+?).

dodgyrabbit commented 2 years ago

One more thought - you could install the showkey tool (it it's not already on your distribution) and see what the actual key codes are when pressing on the keyboard or on the streamdeck-ui. On my system, there is no difference between typing the key combination on the keyboard vs streamdeck-ui (see output below).

However, I did notice that if you press alt + / on the keypad that it only prints / 47 0057 0x2f. What this effectively means is that the keypad ignores modifier keys (the alt doesn't do anything). Maybe consider that for your investigation here.

image

karls0 commented 2 years ago

Hi dodgyrabbit, thanks for your answer. For me showkey did not work nicely, so I used xev. When pressing "Alt+/" on my num-pad of the keyboard (btw it's an old Microsoft "Natural Keyboard") I get:

`KeyPress event, serial 38, synthetic NO, window 0x7600001, root 0x1d7, subw 0x0, time 4628504, (-454,11), root:(1967,450), state 0x10, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False

KeyPress event, serial 38, synthetic NO, window 0x7600001, root 0x1d7, subw 0x0, time 4628952, (-454,11), root:(1967,450), state 0x18, keycode 106 (keysym 0xffaf, KP_Divide), same_screen YES, XLookupString gives 1 bytes: (2f) "/" XmbLookupString gives 1 bytes: (2f) "/" XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x7600001, root 0x1d7, subw 0x0, time 4629075, (-454,11), root:(1967,450), state 0x18, keycode 106 (keysym 0xffaf, KP_Divide), same_screen YES, XLookupString gives 1 bytes: (2f) "/" XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x7600001, root 0x1d7, subw 0x0, time 4629305, (-454,11), root:(1967,450), state 0x18, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False`

Using the StreamDeck I get:

`KeyPress event, serial 38, synthetic NO, window 0x7600001, root 0x1d7, subw 0x0, time 4704257, (-311,151), root:(2110,590), state 0x10, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False

KeyPress event, serial 39, synthetic YES, window 0x7600001, root 0x1d7, subw 0x0, time 0, (0,0), root:(0,0), state 0x9, keycode 16 (keysym 0x2f, slash), same_screen NO, XLookupString gives 1 bytes: (2f) "/" XmbLookupString gives 1 bytes: (2f) "/" XFilterEvent returns: False

KeyRelease event, serial 39, synthetic NO, window 0x7600001, root 0x1d7, subw 0x0, time 4704318, (-311,151), root:(2110,590), state 0x18, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False

KeyRelease event, serial 39, synthetic YES, window 0x7600001, root 0x1d7, subw 0x0, time 0, (0,0), root:(0,0), state 0x1, keycode 16 (keysym 0x2f, slash), same_screen NO, XLookupString gives 1 bytes: (2f) "/" XFilterEvent returns: False`

StreamDeck sends "16" , the same code as "shift+7" (german layout), instead of "106". Can you tell what to type into "Press Keys" to get this code? Not a big problem if not, since I can configure the shortcuts Resolve uses, but I prefer to have the original settings.

TIA, Karl

karls0 commented 2 years ago

Sorry, I forgot the -a parameter with showkey. Trying again I can confirm that Streamdeck snd the same codes as the keyboard, but when you look at the output of xev is different and the behavior of Resolve is different too. Best, Karl

dodgyrabbit commented 2 years ago

@karls0 I managed to figure out how to make this work. I'm going to commit a change to allow us to send the hex key code and then you can simulate the keypress you want. This particular fix will also allow us to make ctrl + alt + t work.

dodgyrabbit commented 2 years ago

Please try version 2.0.2 in #206 Use the KeyCode 0xffaf for the numpad / symbol. For example: alt + 0xffaf

Some updated documentation here: https://github.com/timothycrosley/streamdeck-ui/tree/display-pipeline#press-keys

dodgyrabbit commented 2 years ago

Merged into master.

karls0 commented 2 years ago

Hi Pieter, thank you very much. I installed version 2.0.2 and with the hex-number of the key it works perfectly. Thanks, Karl