I have a friend who is disabled and can only use a commercial head mounted mouth joystick. With this he can use his tong to move the mouse pointer, and a blow down the tube for a click.
Unfortunately he can’t do a double click, nor a right click.
I was wondering if there was a way the Processing could somehow communicate with the computer so that the computer thought the ctrl key was being held down. That way he could click on a processing window that would hold down or release the ctrl key, in much the same was as the shift lock works. This is for a Mac computer.
I can’t think of any way of doing this, is it possible?
Thanks for that.
I have had a look but it seems there is no key code for the ctrl key.
From what I can gather ctrl and shift are modifiers that can only be sent in conjunction with a key code.
What I need to do is to is to have the modifier ctrl key held so that a click on a file becomes a ctrl click.
This is what I have so far, only using the “s” key.
I can see it is working for the S key by dragging the keyboard view next to the Processing window and toggling the S key by clicking the processing window.
Right click on a Mac is a control-click and as far as I know all that gets the user is a contextual menu with menu items such as cut, copy, paste and a few other goodies depending on the app.
What do you hope to achieve with a right click?
There is a KeyEvent.VK_CONTROL and a KeyEvent.CTRL_DOWN_MASK but I’m not sure you can asynchronously connect them with a mouse event using Robot.
@Chrisir
Fantastic this works on my Mac as well.
As far as I can tell this should be fine for my friend. I will try and get it to him shortly for testing but it seems to do everything I asked for.
Many thanks.
I have used the robot class to control mouse and keyboard using my voice, and using depth values from the kinect 3D camera - no matter which other app is active the Processing sketch still moves the mouse, clicks it and sends keystrokes. This is a fun way to play w/paint programs.