• Post Reply Bookmark Topic Watch Topic
  • New Topic

Question regarding JNA and SendInput function  RSS feed

 
Danny Wreczycki
Greenhorn
Posts: 23
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there i cannot get JNA and sendinput to works. Please take a look at my code and if you are familiar with jna point me what exacly im doing wrong.



Ive got stuck at this point and im not able to find any workaround.
 
Paul Clapham
Sheriff
Posts: 22841
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what's wrong with your code because you didn't tell us. What makes you think it doesn't work? Or to put it another way, what evidence can you tell us about?

In the meantime I'm going to guess that you named a method "keyRealesed" and when you try to call the keyReleased method nothing happens because it doesn't exist. Or it doesn't compile for that reason.
 
Danny Wreczycki
Greenhorn
Posts: 23
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:I don't know what's wrong with your code because you didn't tell us. What makes you think it doesn't work? Or to put it another way, what evidence can you tell us about?

In the meantime I'm going to guess that you named a method "keyRealesed" and when you try to call the keyReleased method nothing happens because it doesn't exist. Or it doesn't compile for that reason.



Its do nothing simple nothing, not even throws errors so I cannot even quess whats wrong.
 
Danny Wreczycki
Greenhorn
Posts: 23
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okey I find workaround, and can share if anybody need similiar solution.

First I made simple dll in CodeBlocks and compliled it with mingw.

Source for main.cpp



Source for header file main.h



Now Java part coming together with JNA



You can use it instead of awt.Robot when you need just simulating keyboard events. Its quite nice solution since awt.Robot its limited to predefinied keystrokes so you cannot use it together with special keys like volume up/volume down becouse these keys are not declared for robot.


// So sorry for my bad english
 
Danny Wreczycki
Greenhorn
Posts: 23
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again, I just released my first app with is using this solution. App is called Xbpad and lets you map mouse and keyboard to Xbox360 controller in ease way. I will soon also post source code of the app so you can take a look how to use dlls. App is hosted on sourceforge Xbpad
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!