Java program help
I have checked some tutorials around the web and i need some help on how to do some things not in any of the tutorials that i found.
#1: how to store mouse x and y values into variables.
#2: how to tell what button on the mouse is being pressed.
#3: how to check for #2 every second.(what i mean by this is that when i tried using delay but it doesnt know im clicking on mouse buttons if im doing so during delay time.)
#4: same as #2 and #3 but for keyboard.
I am currently trying to make a program that records mouse/keyboard actions, I just need to know how to do these things, also, if there is any additional info that might be needed for these
You seriously can't find this online when you search? I came across this on every link dealing with a mouseListener.
1-3 can all be done by adding a mouseListener. Look up MouseAdapter and MouseEvent.
1: Getting x and y is as easy as event.x,event.y
2: event.button gets assigned a value(1-n)where n is the number of buttons on your mouse
3: this is done automatically when you attach the listener to your object.
4: Havn't tried anything with keyboard but it's probably really similar just with KeyboardListener or something