jnativehook icon indicating copy to clipboard operation
jnativehook copied to clipboard

can't loop through all the keys

Open martinpro1000 opened this issue 3 years ago • 2 comments

I want to add all the available keys of NativeKeyEvent to an HashMap<String, Integer>(with String being .getKeyText(i); and Integer being the actual key code) and also to a ComboBox, is there any way to do that? I can't find it!

martinpro1000 avatar Jun 20 '22 08:06 martinpro1000

You would need to do it for each individual key combination or use reflection.

kwhat avatar Jun 20 '22 17:06 kwhat

I also created that way:

     for (int i = 0; i < 65406; i++) {
            String text = NativeKeyEvent.getKeyText(i);
            if (!text.startsWith("Unknown")) {
                disableKey.getItems().add(text);
                hashMap.put(text, i);
            }
        }

martinpro1000 avatar Jun 21 '22 08:06 martinpro1000