pynput icon indicating copy to clipboard operation
pynput copied to clipboard

Differentiate numpad arrow keys from standard arrow keys

Open rukkiddo opened this issue 4 years ago • 1 comments

Is there a way to detect arrows keys of numpad is pressed but not normal arrow keys? (which normally works when num lock is off, via 2,4,6 & 8 keys)

String value of key in "def on_key_press(key)" is same for both arrow keys and numpad arrow keys, I want to manipulate only numpad keys.

I'm planning to use my numpad as mouse on linux for a better workflow & I am planning to use pynput for this task. Any help is appreciated.

p.s. I'm aware of linux accessibility settings for the same result & I'm aware of key filtering issue.

rukkiddo avatar Jun 03 '20 11:06 rukkiddo

Same question about other Numpad keys like Insert - it seems there is no easy way with pynput to tell an ordinary Insert apart from a Numpad-Insert?

They're both given as Key.insert with no difference between them.

Providing the win32_event_filter callback to the listener on Windows, I can see that the KBDLLHOOKSTRUCT data construct does have the .flags 1st bit set to 1 on ordinary Insert and 0 on Numpad-Insert. But the object given to listener callback has none of this information..

And there is no such listener callback on Linux.

suurjaak avatar Jan 29 '21 10:01 suurjaak