Wednesday 15 August 2012

input - How can I get the keyboard scan code in java? -


I would like to write an application where the keybinding is specific to the location of the key on the keyboard, not the character mapped For example, for example, the key between T and U on the American keyboard displays a special function, even if it is Y because it is in America or Z as in Germany.

I think the way to do this would be to represent the actual scan code given by the keyboard to the key pressed in the OS. How can I do this in Java?

Or what is another way to get the same functionality?

Like Madeprogrammer said: You have to use JNA or JNI You can also see a look at those projects:

  • (Windows only)
    < P> JointNelType is a Java API that interacts with the Microsoft Intellect command and is registering for global hotkeys in its Java application. API is a Java JNI library that uses C + + DLL to communicate with Windows.

    There are similar projects.

    JNativeHook is a library for providing universal keyboards and mouse listeners for Java is . This will allow you to listen to global shortcuts or mouse motion, which would otherwise be impossible by using Java, to complete this task, JNTK has implemented platform-dependent code-based low-level system through Java's basic interface Extensive hook leverages to create and distribute those events in your program.

  • (Windows only)

    Only Windows 7/8 (32 and 64 bit) )




No comments:

Post a Comment