Mouse
Mouse control needs two kinds of switches set up:
Mouse Active button/toggle to enable mouse control momentarily
Mouse fuctions that move, click, scroll, etc. as long as mouse control is active.
1. Mouse active
mouseActiveButton()
Momentary pushbutton, should be assigned a button number. When held, it will open up for other switches to control the mouse cursor.
mouseActiveButtonMute()
Momentary pushbutton, doesn't output any joystick button press. When held, it will open up for other switches to control the mouse cursor.
mouseActiveLatch()
Use a momentary pushbutton to toggle "Mouse Active" on/off. Doesn't output any joystick button press. When toggled, will open up for other switches to control the mouse cursor.
The status of the toggle will be sent to the buttonField, allowing you to get SimHub properties indicating if mouse contol is active or not.
2. Mouse control
leftMouseButton()
Momentary pushbutton. When "Mouse Active", it will work as the left mouse button. Otherwise work like a normal joystick pushbutton.
rightMouseButton()
Momentary pushbutton. When "Mouse Active", it will work as the right mouse button. Otherwise work like a normal joystick pushbutton.
middleMouseButton()
Momentary pushbutton. When "Mouse Active", it will work as the middle mouse button. Otherwise work like a normal joystick pushbutton.
mouseMove()
Momentary pushbutton. Will works as a normal joystick button, but when "Mouse Active" it will move the mouse cursor in the direction and with the speed you set it to. Mouse directions:
Left:
1
orMOUSE_LEFT
Right:
2
orMOUSE_RIGHT
Up:
3
orMOUSE_UP
Down:
4
orMOUSE_DOWN
Mouse speed is a value between 1 and 100. This is a very large range of mouse speed, with 1 barely moving and 100 way too fast. This speed is in pixels/second, so large high resolution displays will need higher mouse speed for the same relative speed.
You'll be able to set two mouse speeds; mouseSpeed1
and mouseSpeed2
. When holding the button, you'll be at mouseSpeed1 for the first 500 ms, then accelerate to mouseSpeed2 between 500-750 ms, and from 750 ms and out be at mouseSpeed2. This is to allow fine and coarse mouse movement with the same button. If you want a constant speed, just set mouseSpeed1 and mouseSpeed2 to the same value.
rotary2Scroll()
Standard incremental encoder setup. Rotating CW will give a button pulse, rotating CCW will give a button pulse with a button number 1 value higher. When "Mouse Active", it will let you scroll up and down.
E18Scroll()
Standard incremental encoder setup. Rotating CW will give a button pulse, rotating CCW will give a button pulse with a button number 1 value higher. When "Mouse Active", it will let you scroll up and down.
PEC11Scroll()
Standard incremental encoder setup. Rotating CW will give a button pulse, rotating CCW will give a button pulse with a button number 1 value higher. When "Mouse Active", it will let you scroll up and down.
funkyMouseButton()
Intended for funky center push button, but will also work for the directional input. When "Mouse Active", it will work as the left mouse button. Otherwise work like a normal joystick pushbutton.
funkyMouseMove()
Intended for funky directional inputs. Will work as a normal joystick button, but when "Mouse Active" it will move the mouse cursor in the direction and with the speed you set it to. Mouse directions:
Left:
1
orMOUSE_LEFT
Right:
2
orMOUSE_RIGHT
Up:
3
orMOUSE_UP
Down:
4
orMOUSE_DOWN
Mouse speed is a value between 1 and 100. This is a very large range of mouse speed, with 1 barely moving and 100 way too fast. This speed is in pixels/second, so large high resolution displays will need higher mouse speed for the same relative speed.
You'll be able to set two mouse speeds; mouseSpeed1
and mouseSpeed2
. When holding the button, you'll be at mouseSpeed1 for the first 500 ms, then accelerate to mouseSpeed2 between 500-750 ms, and from 750 ms and out be at mouseSpeed2. This is to allow fine and coarse mouse movement with the same button. If you want a constant speed, just set mouseSpeed1 and mouseSpeed2 to the same value.
funkyMouseScroll()
Standard incremental encoder setup. Rotating CW will give a button pulse, rotating CCW will give a button pulse with a button number 1 value higher. When "Mouse Active", it will let you scroll up and down.
analogMouse()
Set up a thumb stick to control the mouse cursor. This will require a whole lot of plotting values, since both axis of the switch should be calibrated for center, extreme negative and extreme positive positions. Any pushbutton built into the switch should be programmed with functions like pushButton(), biteButton(), etc., and are not included in this function.
You can read values from your analog channels using the serial monitor.
This switch does not require a mouseActive-button.
dualClutchAndMouse()
This is the same as dualClutchCal(), but with mouse control built in.
This is probably the worst way to control the mouse cursor, out of all available options. But if clutch paddles is all you have, this will work fine with some practice!
The idea is that the slave paddle will controll the direction of the mouse movement and the master paddle will controll the mouse speed. So in essence the slave paddle is the steering wheel and the master paddle is the throttle for racing the mouse cursor across the screen.
Mouse features are unlocked by holding/toggling a mouseActive
button, or setting MOUSE_ALWAYS_ACTIVE
to 1
in 2_Boards.ino.
Clutch features:
4 modes:
0: Static - The slave paddle only reaches bite point, the master paddle goes to 100%
1: Dynamic low - Either paddle alone only reaches bite point, press both together to reach 100%
2: Dynamic high - Either paddle alone reaches 100%. Press both and release one to get to bite point.
3: Brake/throttle - Using the paddles as brake and throttle. Output now changes from joystick X axis to brake/throttle axis.
Changing modes are done by holding the modButton and pressing either paddle all the way in and releasing. If this doesnt work, it is a good indication that your clutch doesnt reach a stable 100% or rest at a stable 0% - which means you should adjust your values.
The function defaults to bits 13 and 14 in the rotary field. Will be returned by SimHub as property [DahlDesign.DDCclutchMode].
With to calibrate the output from your paddles you'll need to set up a clutchCalibrate() button.
Last updated