hid: Deprecate old input interface

This commit is contained in:
fincs 2020-12-01 13:08:00 +01:00
parent d290697bfd
commit e904bb05d4
No known key found for this signature in database
GPG Key ID: 62C7609ADA219C60

View File

@ -11,6 +11,9 @@
#include "../services/btdrv_types.h" #include "../services/btdrv_types.h"
#include "../sf/service.h" #include "../sf/service.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
// Begin enums and output structs // Begin enums and output structs
/// HidDebugPadButton /// HidDebugPadButton
@ -61,8 +64,8 @@ typedef enum {
HidKeyboardModifier_Hiragana = BIT(12), HidKeyboardModifier_Hiragana = BIT(12),
} HidKeyboardModifier; } HidKeyboardModifier;
/// HidKeyboardScancode /// HidKeyboardScancode \deprecated
typedef enum { typedef enum DEPRECATED {
KBD_NONE = 0x00, KBD_NONE = 0x00,
KBD_ERR_OVF = 0x01, KBD_ERR_OVF = 0x01,
@ -335,8 +338,8 @@ typedef enum {
HidNpadButton_AnySR = HidNpadButton_LeftSR | HidNpadButton_RightSR, ///< Bitmask containing SR buttons on both Joy-Cons (Left/Right) HidNpadButton_AnySR = HidNpadButton_LeftSR | HidNpadButton_RightSR, ///< Bitmask containing SR buttons on both Joy-Cons (Left/Right)
} HidNpadButton; } HidNpadButton;
/// HidControllerKeys /// HidControllerKeys \deprecated
typedef enum { typedef enum DEPRECATED {
KEY_A = HidNpadButton_A, KEY_A = HidNpadButton_A,
KEY_B = HidNpadButton_B, KEY_B = HidNpadButton_B,
KEY_X = HidNpadButton_X, KEY_X = HidNpadButton_X,
@ -384,8 +387,8 @@ typedef enum {
KEY_SR = HidNpadButton_AnySR, KEY_SR = HidNpadButton_AnySR,
} HidControllerKeys; } HidControllerKeys;
/// HidControllerJoystick /// HidControllerJoystick \deprecated
typedef enum { typedef enum DEPRECATED {
JOYSTICK_LEFT = 0, JOYSTICK_LEFT = 0,
JOYSTICK_RIGHT = 1, JOYSTICK_RIGHT = 1,
@ -454,8 +457,8 @@ typedef enum {
HidGestureType_Rotate = 9, ///< Rotate HidGestureType_Rotate = 9, ///< Rotate
} HidGestureType; } HidGestureType;
/// HidControllerID /// HidControllerID \deprecated
typedef enum { typedef enum DEPRECATED {
CONTROLLER_PLAYER_1 = 0, CONTROLLER_PLAYER_1 = 0,
CONTROLLER_PLAYER_2 = 1, CONTROLLER_PLAYER_2 = 1,
CONTROLLER_PLAYER_3 = 2, CONTROLLER_PLAYER_3 = 2,
@ -670,8 +673,8 @@ typedef enum {
HidPalmaFeature_MuteSwitch = BIT(3), ///< MuteSwitch HidPalmaFeature_MuteSwitch = BIT(3), ///< MuteSwitch
} HidPalmaFeature; } HidPalmaFeature;
/// touchPosition /// touchPosition \deprecated
typedef struct touchPosition { typedef struct DEPRECATED touchPosition {
u32 id; u32 id;
u32 px; u32 px;
u32 py; u32 py;
@ -686,14 +689,14 @@ typedef struct HidAnalogStickState {
s32 y; ///< Y s32 y; ///< Y
} HidAnalogStickState; } HidAnalogStickState;
/// JoystickPosition /// JoystickPosition \deprecated
typedef struct JoystickPosition { typedef struct DEPRECATED JoystickPosition {
s32 dx; s32 dx;
s32 dy; s32 dy;
} JoystickPosition; } JoystickPosition;
/// MousePosition /// MousePosition \deprecated
typedef struct MousePosition { typedef struct DEPRECATED MousePosition {
s32 x; s32 x;
s32 y; s32 y;
s32 velocityX; s32 velocityX;
@ -714,8 +717,8 @@ typedef struct HidDirectionState {
float direction[3][3]; ///< 3x3 matrix float direction[3][3]; ///< 3x3 matrix
} HidDirectionState; } HidDirectionState;
/// SixAxisSensorValues /// SixAxisSensorValues \deprecated DEPRECATED
typedef struct SixAxisSensorValues { typedef struct DEPRECATED SixAxisSensorValues {
HidVector accelerometer; HidVector accelerometer;
HidVector gyroscope; HidVector gyroscope;
HidVector unk; HidVector unk;
@ -1315,7 +1318,7 @@ Result hidInitialize(void);
/// Exit hid. Called automatically during app exit. /// Exit hid. Called automatically during app exit.
void hidExit(void); void hidExit(void);
void hidReset(void); void DEPRECATED hidReset(void); ///< \deprecated
/// Gets the Service object for the actual hid service session. /// Gets the Service object for the actual hid service session.
Service* hidGetServiceSession(void); Service* hidGetServiceSession(void);
@ -1323,7 +1326,7 @@ Service* hidGetServiceSession(void);
/// Gets the address of the SharedMemory. /// Gets the address of the SharedMemory.
void* hidGetSharedmemAddr(void); void* hidGetSharedmemAddr(void);
void hidScanInput(void); void DEPRECATED hidScanInput(void); ///< \deprecated
///@name TouchScreen ///@name TouchScreen
///@{ ///@{
@ -1583,37 +1586,38 @@ size_t hidGetGestureStates(HidGestureState *states, size_t count);
///@} ///@}
bool hidIsControllerConnected(HidControllerID id); bool DEPRECATED hidIsControllerConnected(HidControllerID id); ///< \deprecated
u64 hidKeysHeld(HidControllerID id); u64 DEPRECATED hidKeysHeld(HidControllerID id); ///< \deprecated
u64 hidKeysDown(HidControllerID id); u64 DEPRECATED hidKeysDown(HidControllerID id); ///< \deprecated
u64 hidKeysUp(HidControllerID id); u64 DEPRECATED hidKeysUp(HidControllerID id); ///< \deprecated
u64 hidMouseButtonsHeld(void); u64 DEPRECATED hidMouseButtonsHeld(void); ///< \deprecated
u64 hidMouseButtonsDown(void); u64 DEPRECATED hidMouseButtonsDown(void); ///< \deprecated
u64 hidMouseButtonsUp(void); u64 DEPRECATED hidMouseButtonsUp(void); ///< \deprecated
void hidMouseRead(MousePosition *pos); void DEPRECATED hidMouseRead(MousePosition *pos); ///< \deprecated
u32 hidMouseMultiRead(MousePosition *entries, u32 num_entries); u32 DEPRECATED hidMouseMultiRead(MousePosition *entries, u32 num_entries); ///< \deprecated
bool hidKeyboardModifierHeld(HidKeyboardModifier modifier); bool DEPRECATED hidKeyboardModifierHeld(HidKeyboardModifier modifier); ///< \deprecated
bool hidKeyboardModifierDown(HidKeyboardModifier modifier); bool DEPRECATED hidKeyboardModifierDown(HidKeyboardModifier modifier); ///< \deprecated
bool hidKeyboardModifierUp(HidKeyboardModifier modifier); bool DEPRECATED hidKeyboardModifierUp(HidKeyboardModifier modifier); ///< \deprecated
bool hidKeyboardHeld(HidKeyboardScancode key); bool DEPRECATED hidKeyboardHeld(HidKeyboardScancode key); ///< \deprecated
bool hidKeyboardDown(HidKeyboardScancode key); bool DEPRECATED hidKeyboardDown(HidKeyboardScancode key); ///< \deprecated
bool hidKeyboardUp(HidKeyboardScancode key); bool DEPRECATED hidKeyboardUp(HidKeyboardScancode key); ///< \deprecated
u32 hidTouchCount(void); u32 DEPRECATED hidTouchCount(void); ///< \deprecated
void hidTouchRead(touchPosition *pos, u32 point_id); void DEPRECATED hidTouchRead(touchPosition *pos, u32 point_id); ///< \deprecated
void hidJoystickRead(JoystickPosition *pos, HidControllerID id, HidControllerJoystick stick); void DEPRECATED hidJoystickRead(JoystickPosition *pos, HidControllerID id, HidControllerJoystick stick); ///< \deprecated
u32 hidSixAxisSensorValuesRead(SixAxisSensorValues *values, HidControllerID id, u32 num_entries); u32 DEPRECATED hidSixAxisSensorValuesRead(SixAxisSensorValues *values, HidControllerID id, u32 num_entries); ///< \deprecated
/** /**
* @brief This can be used to check what CONTROLLER_P1_AUTO uses. * @brief This can be used to check what CONTROLLER_P1_AUTO uses.
* @return 0 when CONTROLLER_PLAYER_1 is connected, otherwise returns 1 for handheld-mode. * @return 0 when CONTROLLER_PLAYER_1 is connected, otherwise returns 1 for handheld-mode.
* @deprecated
*/ */
bool hidGetHandheldMode(void); bool DEPRECATED hidGetHandheldMode(void);
/** /**
* @brief SendKeyboardLockKeyEvent * @brief SendKeyboardLockKeyEvent
@ -2330,3 +2334,4 @@ Result hidSetTouchScreenConfiguration(const HidTouchScreenConfigurationForNx *co
*/ */
Result hidIsFirmwareUpdateNeededForNotification(bool *out); Result hidIsFirmwareUpdateNeededForNotification(bool *out);
#pragma GCC diagnostic pop