Archived

This topic is now archived and is closed to further replies.

Xorcist

Global Joystick Hook...

Recommended Posts

Xorcist    122
I want to write a program to globally catch various activities from an attached Joystick, so I can then bind keyboard keys to each button/axis, and emulate the keypresses through the Joystick. Programs like RB-Joy and JoyToKey are working examples, but their source is not available. I assume I could use SDL or DirectX to capture these actions, however each has it''s own quirks, and require alot of setup for each individual device attached (SDL can''t handle more that two under Windows). Not to mention how I would go about creating the global Joystick hook after the fact. So does anyone have any ideas? or better yet any links to tutorials or examples...

Share this post


Link to post
Share on other sites
Extrarius    1412
As far as I know, you can''t really hook a joystick. The reason is that under windows (AFAIK)joysticks don''t create any events. To get input from a joystick, you have to poll it and react to the state you get. Your program would essentially just be an infinite loop that polls the joystick and sends a keypress to the active application if needed. You''d probably want some amount of sleeping so your program doesn''t waste CPU (and take it from other programs that could use it better, like a game), but of course you need to balance the amount of delay so that the joystick is still usable as a realtime controller.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
I wanted something like this.. I haven''t been able to find a single thing for Windows... Things for mouse control, yes, but nothing for keyboard.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
http://hp.vector.co.jp/authors/VA016823/joytokey/english.html has exactly what *I* was looking for. Given, I haven''t tried it during any kind of game yet. But its basic functionality, it works.

Share this post


Link to post
Share on other sites