Go Back   Java Programming Forums > Java Standard Edition Programming Help > Java Native Interface


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 01-05-2009, 05:42 PM
Freaky Chris's Avatar
Senile Half-Wit
 

Join Date: Mar 2009
Location: UK
Posts: 621
Thanks: 2
Thanked 64 Times in 60 Posts
Freaky Chris will become famous soon enoughFreaky Chris will become famous soon enoughFreaky Chris will become famous soon enough

I'm feeling Cheerful
Default Re: System Wide Mouse/Keyboard Hook

I've now migrated to notepad and command prompt, and at last progress! I've had to ditch all the high level IDEs lol, ah well it's all good .

Anyways, I just wanted to tell you that I have now begun the full coding of the system, so I hope to keep you updated with progress and code.

Can I ask, is there any functionality that you would like me to add? As I don't know how much you know about C++ and JNI so I figure I could add them in at the start.

Thanks,
Chris



Reply With Quote
Sponsored Links
Java Training from DevelopIntelligence
  #12 (permalink)  
Old 05-06-2009, 08:49 AM
Freaky Chris's Avatar
Senile Half-Wit
 

Join Date: Mar 2009
Location: UK
Posts: 621
Thanks: 2
Thanked 64 Times in 60 Posts
Freaky Chris will become famous soon enoughFreaky Chris will become famous soon enoughFreaky Chris will become famous soon enough

I'm feeling Cheerful
Default Re: System Wide Mouse/Keyboard Hook

Just wanted to give you an update, I haven't had much chance to get to work on this due to college exams. But I am now in the middle of my exams and will be finished at the end of next week. So hopefully I will be able to dig out old code and go back over this and finish it off and get the code to you

Also i'd like to produce a sample macro'ing program using it and the Robot API, which should be quite nice.

Regards,
Chris
Reply With Quote
  #13 (permalink)  
Old 05-06-2009, 09:40 AM
JavaPF's Avatar
mmm.. coffee
 
8 Highscores

Join Date: May 2008
Location: United Kingdom
Posts: 1,543
Thanks: 98
Thanked 92 Times in 85 Posts
JavaPF is someone you want to know!JavaPF is someone you want to know!JavaPF is someone you want to know!

I'm feeling Relaxed
Default Re: System Wide Mouse/Keyboard Hook

Sounds good Chris I know it will come in very useful. Keep me updated..
__________________
Don't forget to add syntax highlighted code tags around your code: [highlight=Java] code here [/highlight]

Forum Tip: Add to peoples reputation () by clicking the button on their useful posts.
Reply With Quote
  #14 (permalink)  
Old 15-06-2009, 04:24 AM
Fendaril's Avatar
Member
 

Join Date: Nov 2008
Posts: 54
Thanks: 7
Thanked 5 Times in 5 Posts
Fendaril is on a distinguished road
Default Re: System Wide Mouse/Keyboard Hook

I doubt this is possible in java since it runs off of a Vm. I could be wrong though.

Last edited by Fendaril; 15-06-2009 at 04:27 AM.
Reply With Quote
  #15 (permalink)  
Old 15-06-2009, 01:01 PM
JavaPF's Avatar
mmm.. coffee
 
8 Highscores

Join Date: May 2008
Location: United Kingdom
Posts: 1,543
Thanks: 98
Thanked 92 Times in 85 Posts
JavaPF is someone you want to know!JavaPF is someone you want to know!JavaPF is someone you want to know!

I'm feeling Relaxed
Default Re: System Wide Mouse/Keyboard Hook

Quote:
Originally Posted by Fendaril View Post
I doubt this is possible in java since it runs off of a Vm. I could be wrong though.
Thats why Chris is writing a C hook
__________________
Don't forget to add syntax highlighted code tags around your code: [highlight=Java] code here [/highlight]

Forum Tip: Add to peoples reputation () by clicking the button on their useful posts.
Reply With Quote
  #16 (permalink)  
Old 15-06-2009, 02:19 PM
Freaky Chris's Avatar
Senile Half-Wit
 

Join Date: Mar 2009
Location: UK
Posts: 621
Thanks: 2
Thanked 64 Times in 60 Posts
Freaky Chris will become famous soon enoughFreaky Chris will become famous soon enoughFreaky Chris will become famous soon enough

I'm feeling Cheerful
Default Re: System Wide Mouse/Keyboard Hook

Just for the record it's not complex, its just a god damn stupid with UnsatisfiedLinker error, so its hard to even test things, I don't even know why it is doing that to me -_-

Chris
__________________
chris[at]javaprogrammingforums[dot]com

University of Wales, Bangor
Reply With Quote
  #17 (permalink)  
Old 15-06-2009, 05:10 PM
Freaky Chris's Avatar
Senile Half-Wit
 

Join Date: Mar 2009
Location: UK
Posts: 621
Thanks: 2
Thanked 64 Times in 60 Posts
Freaky Chris will become famous soon enoughFreaky Chris will become famous soon enoughFreaky Chris will become famous soon enough

I'm feeling Cheerful
Default Re: System Wide Mouse/Keyboard Hook

I finally found out what the problem was

I was forgetting to compile it as if it were C code rather than C++, cause C doesn't name mangle like C++ does lol!

Chris
__________________
chris[at]javaprogrammingforums[dot]com

University of Wales, Bangor
Reply With Quote
  #18 (permalink)  
Old 17-06-2009, 06:06 PM
Freaky Chris's Avatar
Senile Half-Wit
 

Join Date: Mar 2009
Location: UK
Posts: 621
Thanks: 2
Thanked 64 Times in 60 Posts
Freaky Chris will become famous soon enoughFreaky Chris will become famous soon enoughFreaky Chris will become famous soon enough

I'm feeling Cheerful
Default Re: System Wide Mouse/Keyboard Hook

ok ok. Now this one is not so much a programming problem, I just want some help with a bit of logic. For the keyboardhook, I've decided what information to proccess, what key is pressed, is the alt key pressed and is it an extended key, plus was it a keyup or keydown.

However for the mouse, there are a fair few different states that need to be proccessed, 9 in actually fact. Now If I do this in C/C++ its not to hard because they have nice names like WM_LMBUTTONDOWN but, then there are a whole list of different things they could be true such as ctrldown and shift downand any other mouse button down. So there would be alot of possibles combinations, which would get messy sending the data back to Java. But if I was to do it in Java i'd have to find out a long list of numbers. So basically, I need to know what key data I should procces in C++ and send to Java, my suggestion is as Follows.

Which button
Up or Down
is ctrl pressed
is shift pressed
x pos
y pos.

Thanks,
Chris
__________________
chris[at]javaprogrammingforums[dot]com

University of Wales, Bangor
Reply With Quote
Reply

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill in the queue from the keyboard help rocafella5007 File I/O & Other I/O Streams 1 29-04-2009 07:39 PM
How to get Mouse Position Freaky Chris Java Code Snippets and Tutorials 0 29-04-2009 05:41 PM
[SOLVED] mobile operating system blackJava Mobile Applications 3 16-04-2009 07:44 PM
How to Control your computers mouse using the Robot Class JavaPF Java Code Snippets and Tutorials 3 11-02-2009 08:17 PM
[SOLVED] How I can control Keyboard? Mohd Java Theory & Questions 3 05-01-2009 11:10 AM


100 most searched terms
Search Cloud
2 dimensional arraylist java 2d arraylist java actionlistener actionlistener in java addactionlistener addactionlistener java convert double to integer java double format java double to integer in java double to integer java drag en drop programmeren java eclipse shortcut keys exception in thread "awt-eventqueue-0" java.lang.outofmemoryerror: java heap space exception in thread "main" java.lang.nullpointerexception exception in thread "main" java.lang.outofmemoryerror: java heap space format double in java format double java get mouse position java java 2d arraylist java actionlistener java double format java double formatting java double to int java double to integer java format double java forum java forums java get mouse position java list to map java mouse position java programming forum java programming forums java programming practice problems java send keystrokes to another application java two dimensional arraylist java.io.ioexception: premature eof java.lang.classformaterror: truncated class file java.lang.outofmemoryerror: java heap space java.util.arraylist jbutton action jbutton actionlistener jtextarea font jtextfield font size jxl.read.biff.biffexception: unable to recognize ole stream programming mutators and generics smack api two dimensional arraylist two dimensional arraylist java unable to sendviapost to url what is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?

All times are GMT. The time now is 02:03 AM.
Powered by vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.