Skip to content

3. Mouses

Maschell edited this page Aug 29, 2016 · 4 revisions

#Overview The controller patcher provides support for USB mouses.

In order be write a config file for a mouse, it must contains the following line as first line (case insensitive):

[Mouse]

#Mouse modes An attached mouse has 2 different modes. In one mode it acts like a cursor, like you have it on your computer and in the other its emulating a stick and 2 buttons.

You can switch between these to mode via a attached keyboard. Simply attach a mouse and keyboard and press F1 to enable aimmode. Press it again to switch back to cursormode.

###Cursormode In this mode, a cursor is rendered on to the screen. Hopefully on both screen, but in some games/apps it will just appear in one of them.
When you press the left mouse button, a touch input at the drawn position is emulated.

###Aimmode In this mode the cursor disappears and the left/right mouse button will be mapped to a gamepad button. When you move your mouse upwards, a stick being pushed up is emulated.

#Button mapping The button mapping is just for the aim mode.

##Ignoring default values You can either complety overwrite the default configuration or just modifying parts of it. When you put the following as the **second **line in the config, the default values will be ignored.

[IgnoreDefault]

###Stick In default in the mouse is emulation the RIGHT stick, but you can change it the left stick with the following line:

EMULATED_STICK=VPAD_L_STICK

###Buttons For mapping the mouse buttons, you can use the following settings:

Left mouse click =  LEFT_CLICK
Right mouse click = RIGHT_CLICK

Each mouse button can be set to one of the following values:

A                   =   VPAD_BUTTON_A
B                   =   VPAD_BUTTON_B
X                   =   VPAD_BUTTON_X
Y                   =   VPAD_BUTTON_Y
Plus                =   VPAD_BUTTON_PLUS
Minus               =   VPAD_BUTTON_MINUS
Home                =   VPAD_BUTTON_HOME
Sync                =   VPAD_BUTTON_SYNC
TV                  =   VPAD_BUTTON_TV

DPAD:

DPAD left           =   VPAD_BUTTON_LEFT
DPAD left           =   VPAD_BUTTON_RIGHT
DPAD left           =   VPAD_BUTTON_UP
DPAD left           =   VPAD_BUTTON_DOWN

Trigger:

ZR                  =   VPAD_BUTTON_ZR
ZL                  =   VPAD_BUTTON_ZL
L                   =   VPAD_BUTTON_L
R                   =   VPAD_BUTTON_R

Sticks:
Stick press left    =   VPAD_BUTTON_STICK_L
Stick press right   =   VPAD_BUTTON_STICK_R

##Default configuration: When you provide no extra config file, the following config will be used:

left click = ZR  
right click = R  
emulated stick = right stick 

#Examples Here some examples of full config files: ###Example 1 Mouse emulating the right stick, left click is X and right click is Y (Overwriting the default):

[Mouse]
[IgnoreDefault]
LEFT_CLICK=VPAD_BUTTON_X
RIGHT_CLICK=VPAD_BUTTON_Y

###Example 2 Mouse emulating the left stick, left click is A and right click is B (Overwriting the default):

[Mouse]
[IgnoreDefault]
LEFT_CLICK=VPAD_BUTTON_A
RIGHT_CLICK=VPAD_BUTTON_B
EMULATED_STICK=VPAD_L_STICK

###Example 3 Mouse emulating the left stick, left click is disabled and right click is B (Overwriting the default):

[Mouse]
[IgnoreDefault]
RIGHT_CLICK=VPAD_BUTTON_B
EMULATED_STICK=VPAD_L_STICK

In this case nothing will happen when you click on the left button. Default configuration will be ignored. ###Example 4 Mouse emulating the right stick, left click is ZR (default) and right click is B (Overwriting the default):

[Mouse]
RIGHT_CLICK=VPAD_BUTTON_B

In this case you only need to add the config for the right click. The remainig buttons will be default configuration.

#TODO:

  • Adding an option to adjust the sensitivity of the mouse.
  • Support for all mouse buttons.