How can a Windows Keyboard Hook Be Implemented with Java?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: How can a Windows Keyboard Hook Be Implemented with Java?

  1. #1
    Join Date
    Apr 2005
    Posts
    4

    How can a Windows Keyboard Hook Be Implemented with Java?

    Hi Everybody,

    In Windows operating system, a hook is a mechanism by which a function can intercept events (messages, mouse actions, keystrokes) before they reach an application. The function can act on events and, in some cases, modify or discard them.

    In VC++ or VB, it can be implemented with SetWindowsHookEx( ), and CallNextHookEx( ). Ho can it be done with C#? Such as Detecting Caps / Num / Scroll Using a System-wide Keyboard Hook with Java (See http://vbnet.mvps.org/index.html?co...sageboxhook.htm as VB example).

    Thanks,

  2. #2
    Join Date
    Jan 2005
    Location
    Limerick, Ireland
    Posts
    19
    You will have to use JNI and write the keyboard hook in C++

    http://java.sun.com/docs/books/tutorial/native1.1/

  3. #3
    Join Date
    Apr 2005
    Posts
    4
    ... or you can use the ready solution, which is available in the WinPack library:

    http://www.jniwrapper.com/winpack_features.jsp#hooks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center