CPad and CStick as keys
Can now use the CPad as keys eg. WASD for games that don't take joysticks.
This commit is contained in:
parent
b86ad46b98
commit
f3381fb2d3
4 changed files with 47 additions and 4 deletions
|
@ -2,6 +2,7 @@ Default port is 8889, if you change this, you must change it in the 3DS's 3DSCon
|
|||
|
||||
Circle Pad, C Stick and Touch can be MOUSE, JOYSTICK1 or JOYSTICK2
|
||||
JOYSTICK1 uses X and Y. JOYSTICK2 uses Rx and Ry. These are 0, 1, 3 and 4 respectively, leaving 2 and 5 unused.
|
||||
Circle Pad and C Stick may also be set to KEYS, which will enable Pad directions to map to regular keys (no vJoy necessary).
|
||||
|
||||
Mouse Speed controls how fast the Circle Pad or Touch Screen moves the mouse. If set to 0 and using the Touch Screen, it will set to the absolute position, rather than moving relatively to last position,
|
||||
|
||||
|
@ -36,10 +37,21 @@ L: L
|
|||
R: R
|
||||
ZL: Q
|
||||
ZR: W
|
||||
Start: ENTER
|
||||
Select: BACKSPACE
|
||||
Tap: SPACE
|
||||
|
||||
Left: LEFT
|
||||
Right: RIGHT
|
||||
Up: UP
|
||||
Down: DOWN
|
||||
Start: ENTER
|
||||
Select: BACKSPACE
|
||||
Tap: SPACE
|
||||
|
||||
Pad Left: 1
|
||||
Pad Right: 2
|
||||
Pad Up: 3
|
||||
Pad Down: 4
|
||||
|
||||
C Stick Left: 5
|
||||
C Stick Right: 6
|
||||
C Stick Up: 7
|
||||
C Stick Down: 8
|
|
@ -8,6 +8,7 @@ enum analogue {
|
|||
mouse,
|
||||
joystick1,
|
||||
joystick2,
|
||||
keys,
|
||||
};
|
||||
|
||||
struct settings {
|
||||
|
@ -18,7 +19,7 @@ struct settings {
|
|||
enum analogue touch;
|
||||
int mouseSpeed;
|
||||
UINT vJoyDevice;
|
||||
struct keyMapping A, B, X, Y, L, R, ZL, ZR, Left, Right, Up, Down, Start, Select, Tap;
|
||||
struct keyMapping A, B, X, Y, L, R, ZL, ZR, Start, Select, Tap, Left, Right, Up, Down, PadLeft, PadRight, PadUp, PadDown, CSLeft, CSRight, CSUp, CSDown;
|
||||
};
|
||||
|
||||
extern struct settings settings;
|
||||
|
|
|
@ -136,6 +136,20 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow)
|
|||
handleKey(KEY_X, settings.X);
|
||||
handleKey(KEY_Y, settings.Y);
|
||||
|
||||
if(settings.circlePad == keys) {
|
||||
handleKey(KEY_CPAD_RIGHT, settings.PadRight);
|
||||
handleKey(KEY_CPAD_LEFT, settings.PadLeft);
|
||||
handleKey(KEY_CPAD_UP, settings.PadUp);
|
||||
handleKey(KEY_CPAD_DOWN, settings.PadDown);
|
||||
}
|
||||
|
||||
if(settings.cStick == keys) {
|
||||
handleKey(KEY_CSTICK_RIGHT, settings.CSRight);
|
||||
handleKey(KEY_CSTICK_LEFT, settings.CSLeft);
|
||||
handleKey(KEY_CSTICK_UP, settings.CSUp);
|
||||
handleKey(KEY_CSTICK_DOWN, settings.CSDown);
|
||||
}
|
||||
|
||||
//handleKey(KEY_LID, 'I');
|
||||
|
||||
if(newpress(KEY_TOUCH)) {
|
||||
|
|
|
@ -133,12 +133,14 @@ bool readSettings(void) {
|
|||
if(strcmp(setting, "MOUSE") == 0) settings.circlePad = mouse;
|
||||
else if(strcmp(setting, "JOYSTICK1") == 0) settings.circlePad = joystick1;
|
||||
else if(strcmp(setting, "JOYSTICK2") == 0) settings.circlePad = joystick2;
|
||||
else if(strcmp(setting, "KEYS") == 0) settings.circlePad = keys;
|
||||
}
|
||||
|
||||
if(getSetting("C Stick: ", buffer, setting)) {
|
||||
if(strcmp(setting, "MOUSE") == 0) settings.cStick = mouse;
|
||||
else if(strcmp(setting, "JOYSTICK1") == 0) settings.cStick = joystick1;
|
||||
else if(strcmp(setting, "JOYSTICK2") == 0) settings.cStick = joystick2;
|
||||
else if(strcmp(setting, "KEYS") == 0) settings.cStick = keys;
|
||||
}
|
||||
|
||||
if(getSetting("Touch: ", buffer, setting)) {
|
||||
|
@ -171,6 +173,20 @@ bool readSettings(void) {
|
|||
if(getSetting("Select: ", buffer, setting)) settings.Select = getButton(setting);
|
||||
if(getSetting("Tap: ", buffer, setting)) settings.Tap = getButton(setting);
|
||||
|
||||
if(settings.circlePad == keys) {
|
||||
if(getSetting("Pad Left: ", buffer, setting)) settings.PadLeft = getButton(setting);
|
||||
if(getSetting("Pad Right: ", buffer, setting)) settings.PadRight = getButton(setting);
|
||||
if(getSetting("Pad Up: ", buffer, setting)) settings.PadUp = getButton(setting);
|
||||
if(getSetting("Pad Down: ", buffer, setting)) settings.PadDown = getButton(setting);
|
||||
}
|
||||
|
||||
if(settings.cStick == keys) {
|
||||
if(getSetting("C Stick Left: ", buffer, setting)) settings.CSLeft = getButton(setting);
|
||||
if(getSetting("C Stick Right: ", buffer, setting)) settings.CSRight = getButton(setting);
|
||||
if(getSetting("C Stick Up: ", buffer, setting)) settings.CSUp = getButton(setting);
|
||||
if(getSetting("C Stick Down: ", buffer, setting)) settings.CSDown = getButton(setting);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue