|
I am developing n android pp to control the mouse of a PC. I am almost done. The app have 4 buttons to control the movements of mouse. Its working for normal click.... But i want the mouse pointer to be moved continuously when i long press those button.... anyone have any idea....
|
|
|
|
|
I would take a look into the Android dragEvent . I haven't had any contact with it, but what I'm thinking is you could have an object on your screen that represents the mouse cursor, and use the dragEvent to move that object around the screen, while sending the X and Y values to the PC, to sync the mouse movement with your Android event.
I suggest you take a look at DragEvent[^]
Full-fledged Java/.NET lover, full-fledged PHP hater.
Full-fledged Google/Microsoft lover, full-fledged Apple hater.
Full-fledged Skype lover, full-fledged YM hater.
|
|
|
|
|
i cant go for that because i alredy have 4 buttons for controlling mouse movement. I want to perform an operation continuously when user long press on them....
|
|
|
|
|
Then you may want to override onKeyDown event and while the button is pressed do your thing. Also, this means you will have to poll for onKeyUp event to make sure the user doesn't take his finger off the button. Basically, you do your operation all the way between onKeyDown and onKeyUp events.
There is a thread on SO that may apply to your particular case here[^]
Full-fledged Java/.NET lover, full-fledged PHP hater.
Full-fledged Google/Microsoft lover, full-fledged Apple hater.
Full-fledged Skype lover, full-fledged YM hater.
|
|
|
|