@kmamal/sdl 1.0.0-8 → 1.0.0-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/README.md +2 -2
- package/binding.gyp +18 -4
- package/package.json +1 -1
- package/scripts/build.mjs +3 -1
- package/scripts/install.mjs +2 -0
- package/scripts/util/common.js +1 -0
- package/src/javascript/audio/audio-stream.js +4 -3
- package/src/javascript/audio/prevent-exit.js +1 -1
- package/src/javascript/events/events-via-poll.js +2 -4
- package/src/javascript/events/index.js +14 -1
- package/src/javascript/events/try.js +3 -0
- package/src/javascript/joystick/joystick-device-instance.js +1 -0
- package/src/javascript/validate.js +5 -0
- package/src/javascript/video/events.js +3 -3
- package/src/javascript/video/window.js +53 -7
- package/src/native/audio.cpp +24 -26
- package/src/native/audio.h +24 -24
- package/src/native/clipboard.h +2 -2
- package/src/native/enums.cpp +14 -1
- package/src/native/enums.h +1 -1
- package/src/native/events.cpp +1 -69
- package/src/native/events.h +69 -69
- package/src/native/gamepad.cpp +65 -4
- package/src/native/gamepad.h +8 -8
- package/src/native/global.cpp +11 -273
- package/src/native/global.h +9 -9
- package/src/native/joystick.cpp +26 -3
- package/src/native/joystick.h +13 -13
- package/src/native/keyboard.cpp +6 -6
- package/src/native/keyboard.h +3 -3
- package/src/native/module.cpp +3 -0
- package/src/native/mouse.cpp +1 -1
- package/src/native/mouse.h +9 -9
- package/src/native/packed.cpp +5 -12
- package/src/native/packed.h +8 -13
- package/src/native/power.cpp +7 -1
- package/src/native/power.h +2 -2
- package/src/native/sensor.cpp +19 -2
- package/src/native/sensor.h +6 -6
- package/src/native/testing.cpp +17 -0
- package/src/native/testing.h +6 -5
- package/src/native/threads.cpp +1 -0
- package/src/native/threads.h +13 -13
- package/src/native/touch.cpp +7 -2
- package/src/native/touch.h +2 -2
- package/src/native/video.cpp +68 -5
- package/src/native/video.h +5 -5
- package/src/native/window.cpp +46 -1
- package/src/native/window.h +24 -21
- package/src/types/index.d.ts +16 -1
package/src/native/events.cpp
CHANGED
|
@@ -15,74 +15,6 @@
|
|
|
15
15
|
#include <algorithm>
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
packed::Str events::targets::APP;
|
|
19
|
-
packed::Str events::targets::VIDEO;
|
|
20
|
-
packed::Str events::targets::WINDOW;
|
|
21
|
-
packed::Str events::targets::KEYBOARD;
|
|
22
|
-
packed::Str events::targets::JOYSTICK;
|
|
23
|
-
packed::Str events::targets::GAMEPAD;
|
|
24
|
-
packed::Str events::targets::SENSOR;
|
|
25
|
-
packed::Str events::targets::CLIPBOARD;
|
|
26
|
-
packed::Str events::targets::JOYSTICK_DEVICE;
|
|
27
|
-
packed::Str events::targets::GAMEPAD_DEVICE;
|
|
28
|
-
packed::Str events::targets::AUDIO_DEVICE;
|
|
29
|
-
packed::Str events::targets::CHANGE;
|
|
30
|
-
|
|
31
|
-
packed::Str events::types::QUIT;
|
|
32
|
-
packed::Str events::types::DISPLAY_ADD;
|
|
33
|
-
packed::Str events::types::DISPLAY_REMOVE;
|
|
34
|
-
packed::Str events::types::DISPLAY_ORIENT;
|
|
35
|
-
packed::Str events::types::DISPLAY_MOVE;
|
|
36
|
-
packed::Str events::types::DISPLAY_SCALE;
|
|
37
|
-
packed::Str events::types::DISPLAY_MODE;
|
|
38
|
-
packed::Str events::types::DISPLAY_USABLE;
|
|
39
|
-
packed::Str events::types::DISPLAY_CHANGE;
|
|
40
|
-
packed::Str events::types::SHOW;
|
|
41
|
-
packed::Str events::types::HIDE;
|
|
42
|
-
packed::Str events::types::EXPOSE;
|
|
43
|
-
packed::Str events::types::MOVE;
|
|
44
|
-
packed::Str events::types::RESIZE;
|
|
45
|
-
packed::Str events::types::MINIMIZE;
|
|
46
|
-
packed::Str events::types::MAXIMIZE;
|
|
47
|
-
packed::Str events::types::RESTORE;
|
|
48
|
-
packed::Str events::types::ENTER_FULLSCREEN;
|
|
49
|
-
packed::Str events::types::LEAVE_FULLSCREEN;
|
|
50
|
-
packed::Str events::types::FOCUS;
|
|
51
|
-
packed::Str events::types::BLUR;
|
|
52
|
-
packed::Str events::types::HOVER;
|
|
53
|
-
packed::Str events::types::LEAVE;
|
|
54
|
-
packed::Str events::types::KEY_DOWN;
|
|
55
|
-
packed::Str events::types::KEY_UP;
|
|
56
|
-
packed::Str events::types::TEXT_INPUT;
|
|
57
|
-
packed::Str events::types::MOUSE_MOVE;
|
|
58
|
-
packed::Str events::types::MOUSE_BUTTON_DOWN;
|
|
59
|
-
packed::Str events::types::MOUSE_BUTTON_UP;
|
|
60
|
-
packed::Str events::types::MOUSE_WHEEL;
|
|
61
|
-
packed::Str events::types::DROP_BEGIN;
|
|
62
|
-
packed::Str events::types::DROP_COMPLETE;
|
|
63
|
-
packed::Str events::types::DROP_FILE;
|
|
64
|
-
packed::Str events::types::DROP_TEXT;
|
|
65
|
-
packed::Str events::types::CLOSE;
|
|
66
|
-
packed::Str events::types::RENDER_DEVICE_LOST;
|
|
67
|
-
packed::Str events::types::KEYMAP_CHANGE;
|
|
68
|
-
packed::Str events::types::FINGER_DOWN;
|
|
69
|
-
packed::Str events::types::FINGER_UP;
|
|
70
|
-
packed::Str events::types::FINGER_MOVE;
|
|
71
|
-
packed::Str events::types::FINGER_CANCEL;
|
|
72
|
-
packed::Str events::types::DEVICE_ADD;
|
|
73
|
-
packed::Str events::types::DEVICE_REMOVE;
|
|
74
|
-
packed::Str events::types::DEVICE_FORMAT_CHANGE;
|
|
75
|
-
packed::Str events::types::AXIS_MOTION;
|
|
76
|
-
packed::Str events::types::BUTTON_DOWN;
|
|
77
|
-
packed::Str events::types::BUTTON_UP;
|
|
78
|
-
packed::Str events::types::BALL_MOTION;
|
|
79
|
-
packed::Str events::types::HAT_MOTION;
|
|
80
|
-
packed::Str events::types::POWER_UPDATE;
|
|
81
|
-
packed::Str events::types::STEAM_HANDLE_UPDATE;
|
|
82
|
-
packed::Str events::types::REMAP;
|
|
83
|
-
packed::Str events::types::UPDATE;
|
|
84
|
-
|
|
85
|
-
|
|
86
18
|
static Napi::Env *poll_env = nullptr;
|
|
87
19
|
static Napi::Function *poll_callback = nullptr;
|
|
88
20
|
|
|
@@ -650,7 +582,7 @@ events::isDispatchingFromWatch (const Napi::CallbackInfo &info)
|
|
|
650
582
|
}
|
|
651
583
|
|
|
652
584
|
bool
|
|
653
|
-
events::dispatchEventFromWatch(const SDL_Event &event)
|
|
585
|
+
events::dispatchEventFromWatch (const SDL_Event &event)
|
|
654
586
|
{
|
|
655
587
|
// Only dispatch while no JS callback is running; otherwise the event arrives through the normal poll.
|
|
656
588
|
if (in_callback) { return false; }
|
package/src/native/events.h
CHANGED
|
@@ -9,81 +9,81 @@
|
|
|
9
9
|
namespace events {
|
|
10
10
|
|
|
11
11
|
namespace targets {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
inline constexpr packed::Str APP { "app" };
|
|
13
|
+
inline constexpr packed::Str VIDEO { "video" };
|
|
14
|
+
inline constexpr packed::Str WINDOW { "window" };
|
|
15
|
+
inline constexpr packed::Str KEYBOARD { "keyboard" };
|
|
16
|
+
inline constexpr packed::Str JOYSTICK { "joystick" };
|
|
17
|
+
inline constexpr packed::Str GAMEPAD { "gamepad" };
|
|
18
|
+
inline constexpr packed::Str SENSOR { "sensor" };
|
|
19
|
+
inline constexpr packed::Str CLIPBOARD { "clipboard" };
|
|
20
|
+
inline constexpr packed::Str JOYSTICK_DEVICE { "joystickDevice" };
|
|
21
|
+
inline constexpr packed::Str GAMEPAD_DEVICE { "gamepadDevice" };
|
|
22
|
+
inline constexpr packed::Str AUDIO_DEVICE { "audioDevice" };
|
|
23
|
+
inline constexpr packed::Str CHANGE { "change" };
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
namespace types {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
27
|
+
inline constexpr packed::Str QUIT { "quit" };
|
|
28
|
+
inline constexpr packed::Str DISPLAY_ADD { "displayAdd" };
|
|
29
|
+
inline constexpr packed::Str DISPLAY_REMOVE { "displayRemove" };
|
|
30
|
+
inline constexpr packed::Str DISPLAY_ORIENT { "displayOrient" };
|
|
31
|
+
inline constexpr packed::Str DISPLAY_MOVE { "displayMove" };
|
|
32
|
+
inline constexpr packed::Str DISPLAY_SCALE { "displayScaleChange" };
|
|
33
|
+
inline constexpr packed::Str DISPLAY_MODE { "displayModeChange" };
|
|
34
|
+
inline constexpr packed::Str DISPLAY_USABLE { "displayUsableChange" };
|
|
35
|
+
inline constexpr packed::Str DISPLAY_CHANGE { "displayChange" };
|
|
36
|
+
inline constexpr packed::Str SHOW { "show" };
|
|
37
|
+
inline constexpr packed::Str HIDE { "hide" };
|
|
38
|
+
inline constexpr packed::Str EXPOSE { "expose" };
|
|
39
|
+
inline constexpr packed::Str MOVE { "move" };
|
|
40
|
+
inline constexpr packed::Str RESIZE { "resize" };
|
|
41
|
+
inline constexpr packed::Str MINIMIZE { "minimize" };
|
|
42
|
+
inline constexpr packed::Str MAXIMIZE { "maximize" };
|
|
43
|
+
inline constexpr packed::Str RESTORE { "restore" };
|
|
44
|
+
inline constexpr packed::Str ENTER_FULLSCREEN { "enterFullscreen" };
|
|
45
|
+
inline constexpr packed::Str LEAVE_FULLSCREEN { "leaveFullscreen" };
|
|
46
|
+
inline constexpr packed::Str FOCUS { "focus" };
|
|
47
|
+
inline constexpr packed::Str BLUR { "blur" };
|
|
48
|
+
inline constexpr packed::Str HOVER { "hover" };
|
|
49
|
+
inline constexpr packed::Str LEAVE { "leave" };
|
|
50
|
+
inline constexpr packed::Str KEY_DOWN { "keyDown" };
|
|
51
|
+
inline constexpr packed::Str KEY_UP { "keyUp" };
|
|
52
|
+
inline constexpr packed::Str TEXT_INPUT { "textInput" };
|
|
53
|
+
inline constexpr packed::Str MOUSE_MOVE { "mouseMove" };
|
|
54
|
+
inline constexpr packed::Str MOUSE_BUTTON_DOWN { "mouseButtonDown" };
|
|
55
|
+
inline constexpr packed::Str MOUSE_BUTTON_UP { "mouseButtonUp" };
|
|
56
|
+
inline constexpr packed::Str MOUSE_WHEEL { "mouseWheel" };
|
|
57
|
+
inline constexpr packed::Str DROP_BEGIN { "dropBegin" };
|
|
58
|
+
inline constexpr packed::Str DROP_COMPLETE { "dropComplete" };
|
|
59
|
+
inline constexpr packed::Str DROP_FILE { "dropFile" };
|
|
60
|
+
inline constexpr packed::Str DROP_TEXT { "dropText" };
|
|
61
|
+
inline constexpr packed::Str CLOSE { "close" };
|
|
62
|
+
inline constexpr packed::Str RENDER_DEVICE_LOST { "renderDeviceLost" };
|
|
63
|
+
inline constexpr packed::Str KEYMAP_CHANGE { "keymapChange" };
|
|
64
|
+
inline constexpr packed::Str FINGER_DOWN { "fingerDown" };
|
|
65
|
+
inline constexpr packed::Str FINGER_UP { "fingerUp" };
|
|
66
|
+
inline constexpr packed::Str FINGER_MOVE { "fingerMove" };
|
|
67
|
+
inline constexpr packed::Str FINGER_CANCEL { "fingerCancel" };
|
|
68
|
+
inline constexpr packed::Str DEVICE_ADD { "deviceAdd" };
|
|
69
|
+
inline constexpr packed::Str DEVICE_REMOVE { "deviceRemove" };
|
|
70
|
+
inline constexpr packed::Str DEVICE_FORMAT_CHANGE { "deviceFormatChange" };
|
|
71
|
+
inline constexpr packed::Str AXIS_MOTION { "axisMotion" };
|
|
72
|
+
inline constexpr packed::Str BUTTON_DOWN { "buttonDown" };
|
|
73
|
+
inline constexpr packed::Str BUTTON_UP { "buttonUp" };
|
|
74
|
+
inline constexpr packed::Str BALL_MOTION { "ballMotion" };
|
|
75
|
+
inline constexpr packed::Str HAT_MOTION { "hatMotion" };
|
|
76
|
+
inline constexpr packed::Str POWER_UPDATE { "powerUpdate" };
|
|
77
|
+
inline constexpr packed::Str STEAM_HANDLE_UPDATE { "steamHandleUpdate" };
|
|
78
|
+
inline constexpr packed::Str REMAP { "remap" };
|
|
79
|
+
inline constexpr packed::Str UPDATE { "update" };
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
-
bool dispatchEventFromWatch(const SDL_Event &event);
|
|
82
|
+
bool dispatchEventFromWatch (const SDL_Event &event);
|
|
83
83
|
|
|
84
|
-
Napi::Value isDispatchingFromWatch(const Napi::CallbackInfo &info);
|
|
85
|
-
Napi::Value poll(const Napi::CallbackInfo &info);
|
|
86
|
-
Napi::Value broadcastChange(const Napi::CallbackInfo &info);
|
|
84
|
+
Napi::Value isDispatchingFromWatch (const Napi::CallbackInfo &info);
|
|
85
|
+
Napi::Value poll (const Napi::CallbackInfo &info);
|
|
86
|
+
Napi::Value broadcastChange (const Napi::CallbackInfo &info);
|
|
87
87
|
|
|
88
88
|
}; // namespace events
|
|
89
89
|
|
package/src/native/gamepad.cpp
CHANGED
|
@@ -7,10 +7,71 @@
|
|
|
7
7
|
#include <string>
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
std::map<SDL_GamepadType, packed::Str> gamepad::types
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const std::map<SDL_GamepadType, packed::Str> gamepad::types {
|
|
11
|
+
// { SDL_GAMEPAD_TYPE_UNKNOWN, nullptr },
|
|
12
|
+
{ SDL_GAMEPAD_TYPE_STANDARD, "standard" },
|
|
13
|
+
{ SDL_GAMEPAD_TYPE_XBOX360, "xbox360" },
|
|
14
|
+
{ SDL_GAMEPAD_TYPE_XBOXONE, "xboxOne" },
|
|
15
|
+
{ SDL_GAMEPAD_TYPE_PS3, "ps3" },
|
|
16
|
+
{ SDL_GAMEPAD_TYPE_PS4, "ps4" },
|
|
17
|
+
{ SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO, "nintendoSwitchPro" },
|
|
18
|
+
{ SDL_GAMEPAD_TYPE_PS5, "ps5" },
|
|
19
|
+
{ SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT, "nintendoSwitchJoyconLeft" },
|
|
20
|
+
{ SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT, "nintendoSwitchJoyconRight" },
|
|
21
|
+
{ SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR, "nintendoSwitchJoyconPair" },
|
|
22
|
+
{ SDL_GAMEPAD_TYPE_GAMECUBE, "gamecube" },
|
|
23
|
+
{ SDL_GAMEPAD_TYPE_STEAM, "steam" },
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const std::map<SDL_GamepadAxis, packed::Str> gamepad::axes {
|
|
27
|
+
{ SDL_GAMEPAD_AXIS_LEFTX, "leftStickX" },
|
|
28
|
+
{ SDL_GAMEPAD_AXIS_LEFTY, "leftStickY" },
|
|
29
|
+
{ SDL_GAMEPAD_AXIS_RIGHTX, "rightStickX" },
|
|
30
|
+
{ SDL_GAMEPAD_AXIS_RIGHTY, "rightStickY" },
|
|
31
|
+
{ SDL_GAMEPAD_AXIS_LEFT_TRIGGER, "leftTrigger" },
|
|
32
|
+
{ SDL_GAMEPAD_AXIS_RIGHT_TRIGGER, "rightTrigger" },
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const std::map<SDL_GamepadButton, packed::Str> gamepad::buttons {
|
|
36
|
+
{ SDL_GAMEPAD_BUTTON_DPAD_LEFT, "dpadLeft" },
|
|
37
|
+
{ SDL_GAMEPAD_BUTTON_DPAD_RIGHT, "dpadRight" },
|
|
38
|
+
{ SDL_GAMEPAD_BUTTON_DPAD_UP, "dpadUp" },
|
|
39
|
+
{ SDL_GAMEPAD_BUTTON_DPAD_DOWN, "dpadDown" },
|
|
40
|
+
{ SDL_GAMEPAD_BUTTON_SOUTH, "south" },
|
|
41
|
+
{ SDL_GAMEPAD_BUTTON_EAST, "east" },
|
|
42
|
+
{ SDL_GAMEPAD_BUTTON_WEST, "west" },
|
|
43
|
+
{ SDL_GAMEPAD_BUTTON_NORTH, "north" },
|
|
44
|
+
{ SDL_GAMEPAD_BUTTON_GUIDE, "guide" },
|
|
45
|
+
{ SDL_GAMEPAD_BUTTON_BACK, "back" },
|
|
46
|
+
{ SDL_GAMEPAD_BUTTON_START, "start" },
|
|
47
|
+
{ SDL_GAMEPAD_BUTTON_LEFT_STICK, "leftStick" },
|
|
48
|
+
{ SDL_GAMEPAD_BUTTON_RIGHT_STICK, "rightStick" },
|
|
49
|
+
{ SDL_GAMEPAD_BUTTON_LEFT_SHOULDER, "leftShoulder" },
|
|
50
|
+
{ SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER, "rightShoulder" },
|
|
51
|
+
{ SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1, "rightPaddle1" },
|
|
52
|
+
{ SDL_GAMEPAD_BUTTON_LEFT_PADDLE1, "leftPaddle1" },
|
|
53
|
+
{ SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2, "rightPaddle2" },
|
|
54
|
+
{ SDL_GAMEPAD_BUTTON_LEFT_PADDLE2, "leftPaddle2" },
|
|
55
|
+
{ SDL_GAMEPAD_BUTTON_MISC1, "misc1" },
|
|
56
|
+
{ SDL_GAMEPAD_BUTTON_MISC2, "misc2" },
|
|
57
|
+
{ SDL_GAMEPAD_BUTTON_MISC3, "misc3" },
|
|
58
|
+
{ SDL_GAMEPAD_BUTTON_MISC4, "misc4" },
|
|
59
|
+
{ SDL_GAMEPAD_BUTTON_MISC5, "misc5" },
|
|
60
|
+
{ SDL_GAMEPAD_BUTTON_MISC6, "misc6" },
|
|
61
|
+
{ SDL_GAMEPAD_BUTTON_TOUCHPAD, "touchpad" },
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const std::map<SDL_GamepadButtonLabel, packed::Str> gamepad::button_labels {
|
|
65
|
+
// { SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN, nullptr },
|
|
66
|
+
{ SDL_GAMEPAD_BUTTON_LABEL_A, "a" },
|
|
67
|
+
{ SDL_GAMEPAD_BUTTON_LABEL_B, "b" },
|
|
68
|
+
{ SDL_GAMEPAD_BUTTON_LABEL_X, "x" },
|
|
69
|
+
{ SDL_GAMEPAD_BUTTON_LABEL_Y, "y" },
|
|
70
|
+
{ SDL_GAMEPAD_BUTTON_LABEL_CROSS, "cross" },
|
|
71
|
+
{ SDL_GAMEPAD_BUTTON_LABEL_CIRCLE, "circle" },
|
|
72
|
+
{ SDL_GAMEPAD_BUTTON_LABEL_SQUARE, "square" },
|
|
73
|
+
{ SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE, "triangle" },
|
|
74
|
+
};
|
|
14
75
|
|
|
15
76
|
|
|
16
77
|
double
|
package/src/native/gamepad.h
CHANGED
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
|
|
9
9
|
namespace gamepad {
|
|
10
10
|
|
|
11
|
-
extern std::map<SDL_GamepadType, packed::Str> types;
|
|
12
|
-
extern std::map<SDL_GamepadAxis, packed::Str> axes;
|
|
13
|
-
extern std::map<SDL_GamepadButton, packed::Str> buttons;
|
|
14
|
-
extern std::map<SDL_GamepadButtonLabel, packed::Str> button_labels;
|
|
11
|
+
extern const std::map<SDL_GamepadType, packed::Str> types;
|
|
12
|
+
extern const std::map<SDL_GamepadAxis, packed::Str> axes;
|
|
13
|
+
extern const std::map<SDL_GamepadButton, packed::Str> buttons;
|
|
14
|
+
extern const std::map<SDL_GamepadButtonLabel, packed::Str> button_labels;
|
|
15
15
|
|
|
16
16
|
double mapAxis (SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
|
|
17
17
|
void getState (SDL_Gamepad *gamepad, packed::Value &dst);
|
|
18
|
-
packed::Value getSteamHandle(SDL_Gamepad *gamepad);
|
|
18
|
+
packed::Value getSteamHandle (SDL_Gamepad *gamepad);
|
|
19
19
|
|
|
20
|
-
Napi::Value addMappings(const Napi::CallbackInfo &info);
|
|
21
|
-
Napi::Value open(const Napi::CallbackInfo &info);
|
|
22
|
-
Napi::Value close(const Napi::CallbackInfo &info);
|
|
20
|
+
Napi::Value addMappings (const Napi::CallbackInfo &info);
|
|
21
|
+
Napi::Value open (const Napi::CallbackInfo &info);
|
|
22
|
+
Napi::Value close (const Napi::CallbackInfo &info);
|
|
23
23
|
|
|
24
24
|
}; // namespace gamepad
|
|
25
25
|
|