Hi there
I would like to make a system where different button imputs on the Arduino generates mouse movement and clicking on different objects on a MAC. Sounds easy - well not for me.
I have tryed to use AAC keys. I can generate mouse movement both as goto and move:
void goTo(int a, int b){
Serial.print("\033,goto,");
Serial.print(a+random(-1,2));
Serial.print(",");
Serial.print(b+random(-1,2));
Serial.print(".");
}
void moVe(int a, int b){
Serial.print("\033,move,");
if(a > -1) Serial.print("+");
Serial.print(a+random(-1,2));
Serial.print(",");
if(b > -1) Serial.print("+");
Serial.print(b+random(-1,2));
Serial.print(".");
}
It even has a bit of random jitter build in. The problem is that mouse over on objects are not updated after the move, and I real need this.
Using the build in Mouse Keys in OS X does not help. If I press the "o" button on the keyboard I get a mouse over update, but if I send and "o" over the Serial.print the Mouse Keys does not yeld a mouse movement so no update :-/
Command key, option key and rightclick is also behaveing a bit strangely but I could probaly live with that.
I have tryed to look at makeing the Arduino emulate a mouse. The PS/2 lib seems stright forward .... but there is no PS/2 on the MAC and investing in an PS/2 to USB converter that might (or might not work) seems like a long shot. Then I thought about makeing the Arduino emulate an USB mouse ... google ... read ... No go :-/
I tryed gutting an old USB mouse. Soldering wires to the left click / right click and connect to the Arduing though 2 4N35 optocubling. Hey I can click click click ;D no problem. Movement is a problem.
The chip in the mouse is a cy7C63231A-pc .... reading a bit about CMOS camera (and image chip) and how the movement data goes into cy7.. chip ain't realy helpeing. I did get somthing about dual sinus wave. If I connect the 2 pins from CMOS to cy7.. the mouse makes a slow movement down and left. Trying to use this with a 4N35 gives strange results. Sometimes the mouse moved and sometimes it don't - I guees the signal on those two pins are more advance than just simpel on/off :
Maybe I need the optocubling to drive a small relay chip where current can flow both directions? MOC3020??
- I have tryed to use additional software. DoubleCommand was able to generate movement but still no mouse over update. ControllerMate can generate "correct" movement with update, but this software does not reckognice keystrokes sendt though Serial.print (with AAC enabled ofc)
So here I am. Does anyone know a simpel solution how to generate just a tiny bit of mouse movement so that I get correct mouse over function?
Darn, this post got much longer than I aimed for...
-Fletcher
OS X Version 10.5.8