From aa458e59f90c6cd45021cfc69ed0d09776df525b Mon Sep 17 00:00:00 2001 From: shinyquagsire23 Date: Mon, 20 Nov 2017 12:29:41 -0700 Subject: [PATCH] Add hidGetControllerLayout --- nx/include/switch/services/hid.h | 1 + nx/source/services/hid.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/nx/include/switch/services/hid.h b/nx/include/switch/services/hid.h index d40c89f4..3ac69508 100644 --- a/nx/include/switch/services/hid.h +++ b/nx/include/switch/services/hid.h @@ -504,6 +504,7 @@ Handle hidGetSessionService(void); void* hidGetSharedmemAddr(void); void hidSetControllerLayout(HIDControllerID id, HIDControllerLayoutType layoutType); +HIDControllerLayoutType hidGetControllerLayout(HIDControllerID id); void hidScanInput(void); u64 hidKeysHeld(HIDControllerID id); diff --git a/nx/source/services/hid.c b/nx/source/services/hid.c index b6a0f0ec..69954ace 100644 --- a/nx/source/services/hid.c +++ b/nx/source/services/hid.c @@ -110,6 +110,10 @@ void hidSetControllerLayout(HIDControllerID id, HIDControllerLayoutType layoutTy g_controllerLayout[id] = layoutType; } +HIDControllerLayoutType hidGetControllerLayout(HIDControllerID id) { + return g_controllerLayout[id]; +} + void hidScanInput(void) { if (g_hidServiceSession == INVALID_HANDLE) return; HIDSharedMemory *sharedMem = (HIDSharedMemory*)hidGetSharedmemAddr();