DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  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

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links