What are the key codes for macros on gaming keyboards?

I am looking for keycodes for G1-G18 macros on gaming keyboards i.e. Corsair K90 Keyboard or Logitech Gaming Keyboards. I would like to put global key listeners on these keys in C ++.

G1-G18 are not included in the standard multimedia key code list.

Test code in Java:

public void keyTyped(KeyEvent e){
 System.out.println("Keycode pressed: "+e.getKeyCode());

}

      

It will never have key events when I press any of the G1-G18 macros. I want to be able to receive key events from these keys.

+3


source to share


1 answer


Macro keys are usually proprietary keys shipped with your keyboard driver that perform some action, hard-coded by the control software itself.

Because of this, the system does not actually process any of these events.

If you need to interact with macros, look at the vendor SDK or header that includes things like this. It is not uncommon for them to be delivered using a management utility; look in the directory where the utility app is located and check your C / C ++ header files. You will need to write JNI bindings or use JNA in order to use them from Java.




The best you get with such keys, without directly interacting with the driver, is to configure them to run a specific sequence of macros that the system will send to Java, and have a reaction in your Java program for that specific sequence. It's a hack, yes, but these keys weren't meant to be used this way (usually).




Also, this is not the case, once these keys will be implemented as joystick interfaces , so it might be worth checking if they are sent this way.If there are, then this is probably how you want to interact with them.

+1


source







All Articles