digital-car.co.uk    

Go Back   digital-car.co.uk > Software > CarPC Software > Velocity Frontend

Reply
 
Thread Tools Display Modes
Old 05-07-2007, 01:23 AM   #1
~Rob
Advanced Member
 
~Rob's Avatar
 
Join Date: Apr 2006
Location: Cambridge, UK
Posts: 14,922

~Rob will become famous soon enough
Send a message via MSN to ~Rob Send a message via Skype™ to ~Rob
C# keyhook

Just found this article with some C# code that can register keys where ever the focus is. I don't know how it will work with the JNI, I still need to read up on it
__________________
~Rob - Proving more posts don't mean more knowledge
~Rob is offline   Reply With Quote
Old 05-07-2007, 08:58 AM   #2
Sama
Advanced Member
 
Sama's Avatar
 
Join Date: Apr 2006
Location: London
Posts: 2,154

Sama is on a distinguished road
Send a message via AIM to Sama Send a message via MSN to Sama Send a message via Yahoo to Sama Send a message via Skype™ to Sama
nice find.

DllImport("user32.dll"). This is the first line that will be needed. In Java, you would write System.loadLibrary("user32.dll");

This will give access to the SetWindowsHookEx. I have found a couple of Java COM bridges that give easy access to this. The first is called JACOB, which is a fairly recent open source initiative. And the other is an old one called Java2Com by IBM, but it has a nice feature that recreates the COM object in Java objects for you (using a generator).

Do you fancy writing the windows hooks processor for Velocity, to process key and mouse events, and create a listener mechanisms for all plugins to use?
Sama is offline   Reply With Quote
Old 09-07-2007, 04:25 PM   #3
~Rob
Advanced Member
 
~Rob's Avatar
 
Join Date: Apr 2006
Location: Cambridge, UK
Posts: 14,922

~Rob will become famous soon enough
Send a message via MSN to ~Rob Send a message via Skype™ to ~Rob
I've nearly got this working now. I just need to get the user defined variables to become the hooked key. I've asked how to on the page I linked to. It's also possible to stop the keys being used else where. I'm trying to work out if it's a good or bad thing. Maybe with the JNI it's possible to unblock them if you're on a text-input screen which velocity would know?
__________________
~Rob - Proving more posts don't mean more knowledge
~Rob is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Forum Jump
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT +1. The time now is 08:17 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Website Hosted by
www.wicked-websites.co.uk