mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 04:52:39 +02:00
hid: Various fixes.
This commit is contained in:
parent
d28776e4d9
commit
324a835b0c
@ -328,12 +328,12 @@ typedef enum {
|
||||
|
||||
/// HidNpadAttribute
|
||||
typedef enum {
|
||||
NpadAttribute_IsConnected = BIT(0), ///< IsConnected
|
||||
NpadAttribute_IsWired = BIT(1), ///< IsWired
|
||||
NpadAttribute_IsLeftConnected = BIT(2), ///< IsLeftConnected
|
||||
NpadAttribute_IsLeftWired = BIT(3), ///< IsLeftWired
|
||||
NpadAttribute_IsRightConnected = BIT(4), ///< IsRightConnected
|
||||
NpadAttribute_IsRightWired = BIT(5), ///< IsRightWired
|
||||
HidNpadAttribute_IsConnected = BIT(0), ///< IsConnected
|
||||
HidNpadAttribute_IsWired = BIT(1), ///< IsWired
|
||||
HidNpadAttribute_IsLeftConnected = BIT(2), ///< IsLeftConnected
|
||||
HidNpadAttribute_IsLeftWired = BIT(3), ///< IsLeftWired
|
||||
HidNpadAttribute_IsRightConnected = BIT(4), ///< IsRightConnected
|
||||
HidNpadAttribute_IsRightWired = BIT(5), ///< IsRightWired
|
||||
} HidNpadAttribute;
|
||||
|
||||
/// HidSixAxisSensorAttribute
|
||||
@ -722,7 +722,7 @@ typedef struct HidNpadHandheldLarkState {
|
||||
JoystickPosition joysticks[JOYSTICK_NUM_STICKS];
|
||||
u32 attributes; ///< Bitfield of \ref HidNpadAttribute.
|
||||
HidNpadLarkType lark_type_l_and_main; ///< \ref HidNpadLarkType LarkTypeLAndMain
|
||||
u32 lark_type_r; ///< \ref HidNpadLarkType LarkTypeR
|
||||
HidNpadLarkType lark_type_r; ///< \ref HidNpadLarkType LarkTypeR
|
||||
u32 pad;
|
||||
} HidNpadHandheldLarkState;
|
||||
|
||||
|
@ -258,7 +258,7 @@ void hidScanInput(void) {
|
||||
}
|
||||
|
||||
g_controllerP1AutoID = CONTROLLER_HANDHELD;
|
||||
if (g_controllerEntries[CONTROLLER_PLAYER_1].attributes & NpadAttribute_IsConnected)
|
||||
if (g_controllerEntries[CONTROLLER_PLAYER_1].attributes & HidNpadAttribute_IsConnected)
|
||||
g_controllerP1AutoID = CONTROLLER_PLAYER_1;
|
||||
|
||||
rwlockWriteUnlock(&g_hidLock);
|
||||
@ -706,7 +706,7 @@ bool hidIsControllerConnected(HidControllerID id) {
|
||||
if (id < 0 || id > 9) return 0;
|
||||
|
||||
rwlockReadLock(&g_hidLock);
|
||||
bool flag = (g_controllerEntries[id].attributes & NpadAttribute_IsConnected) != 0;
|
||||
bool flag = (g_controllerEntries[id].attributes & HidNpadAttribute_IsConnected) != 0;
|
||||
rwlockReadUnlock(&g_hidLock);
|
||||
return flag;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user