device_query icon indicating copy to clipboard operation
device_query copied to clipboard

Add Korean IME key support

Open luftaquila opened this issue 1 year ago • 4 comments

I was using this crate in my project and found out that the Korean IME key VK_HANGUL is not captured by the device_query. This key is commonly used on Korean keyboards to toggle between Korean and English IME modes.

I simply added it to the keymap to address this. I would greatly appreciate it if you could kindly merge this change. Thank you!

luftaquila avatar Jan 08 '25 18:01 luftaquila

This is cool! I'd love to add it, but I wanna make sure that we have support for Linux as well. Could you add an update to include Linux? Looking at the source for the keycodes here (https://github.com/torvalds/linux/blob/master/include/uapi/linux/input-event-codes.h), it looks like the keycode is 122.

#define KEY_HANGEUL		122
#define KEY_HANGUEL		KEY_HANGEUL

ostrosco avatar Jan 22 '25 16:01 ostrosco

That's a good point. I've added it to Linux too, but I found out that I can't build device_query on Linux.

warning: no edition set: defaulting to the 2015 edition while the latest is 2021
   Compiling device_query v2.1.0 (/home/luftaquila/workspace/device_query)
error[E0531]: cannot find unit struct, unit variant or constant `KEY_KPDECIMAL` in module `kernel_key`
   --> src/device_state/linux/mod.rs:203:25
    |
203 |             kernel_key::KEY_KPDECIMAL => Some(Keycode::NumpadDecimal),
    |                         ^^^^^^^^^^^^^ help: a constant with a similar name exists: `KEY_KPEQUAL`
    |
   ::: src/device_state/linux/kernel_key.rs:110:1
    |
110 | pub const KEY_KPEQUAL: u16 = 117;
    | --------------------------------- similarly named constant `KEY_KPEQUAL` defined here

For more information about this error, try `rustc --explain E0531`.
error: could not compile `device_query` (lib) due to 1 previous error

And I cannot find KEY_KPDECIMAL in the link you provided too.

luftaquila avatar Jan 24 '25 11:01 luftaquila

Hm, you may be working off of an older version? Yeah it shouldn't be KPDECIMAL at all. It should be KPDOT.

ostrosco avatar Jan 24 '25 22:01 ostrosco

I think mine was based on an old master somewhere 😅. I've fixed it, but I haven't tested it yet since I can't access to the Linux machine with physical keyboards for a week. I'll let you know once I confirm it works on Linux. Thank you!

luftaquila avatar Jan 25 '25 06:01 luftaquila