mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-05 19:02:14 +02:00
hid: Call SetSupportedNpadStyleSet to enable additional Npad features
This commit is contained in:
parent
1cc3547990
commit
5c30cf09d5
@ -592,6 +592,9 @@ void hidJoystickRead(JoystickPosition *pos, HidControllerID id, HidControllerJoy
|
||||
/// Returns 0 when CONTROLLER_PLAYER_1 is connected, otherwise returns 1 for handheld-mode.
|
||||
bool hidGetHandheldMode(void);
|
||||
|
||||
/// Sets which controller types are supported. This is automatically called with all types in \ref hidInitialize.
|
||||
Result hidSetSupportedNpadStyleSet(HidControllerType type);
|
||||
|
||||
/// Use this if you want to use a single joy-con as a dedicated CONTROLLER_PLAYER_*.
|
||||
/// When used, both joy-cons in a pair should be used with this (CONTROLLER_PLAYER_1 and CONTROLLER_PLAYER_2 for example).
|
||||
/// id must be CONTROLLER_PLAYER_*.
|
||||
|
@ -72,6 +72,9 @@ Result hidInitialize(void)
|
||||
rc = shmemMap(&g_hidSharedmem);
|
||||
}
|
||||
|
||||
if (R_SUCCEEDED(rc))
|
||||
rc = hidSetSupportedNpadStyleSet(TYPE_PROCONTROLLER | TYPE_HANDHELD | TYPE_JOYCON_PAIR | TYPE_JOYCON_LEFT | TYPE_JOYCON_RIGHT);
|
||||
|
||||
if (R_SUCCEEDED(rc))
|
||||
rc = _hidSetDualModeAll();
|
||||
|
||||
@ -525,6 +528,10 @@ static Result _hidCmdWithInputU32(u64 cmd_id, u32 inputval) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result hidSetSupportedNpadStyleSet(HidControllerType type) {
|
||||
return _hidCmdWithInputU32(100, type);
|
||||
}
|
||||
|
||||
Result hidSetNpadJoyAssignmentModeSingleByDefault(HidControllerID id) {
|
||||
return _hidCmdWithInputU32(122, id);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user