40 #define _GLFW_JOYSTICK_AXIS 1 41 #define _GLFW_JOYSTICK_BUTTON 2 42 #define _GLFW_JOYSTICK_HATBIT 3 88 "Invalid button in gamepad mapping %s (%s)",
100 "Invalid axis in gamepad mapping %s (%s)",
123 {
"platform",
NULL },
147 length = strcspn(c,
",");
148 if (length != 32 || c[length] !=
',')
154 memcpy(mapping->
guid, c, length);
157 length = strcspn(c,
",");
158 if (length >=
sizeof(mapping->
name) || c[length] !=
',')
164 memcpy(mapping->
name, c, length);
170 if (*c ==
'+' || *c ==
'-')
173 for (i = 0; i <
sizeof(fields) /
sizeof(fields[0]); i++)
175 length = strlen(fields[i].
name);
176 if (strncmp(c, fields[i].name, length) != 0 || c[length] !=
':')
181 if (fields[i].element)
209 const unsigned long hat = strtoul(c + 1, (
char**) &c, 10);
210 const unsigned long bit = strtoul(c + 1, (
char**) &c, 10);
238 c += strcspn(c,
",");
242 for (i = 0; i < 32; i++)
244 if (mapping->
guid[i] >=
'A' && mapping->
guid[i] <=
'F')
245 mapping->
guid[
i] +=
'a' -
'A';
274 window->
keys[
key] = (char) action;
292 if (codepoint < 32 || (codepoint > 126 && codepoint < 160))
432 js->
axes = calloc(axisCount,
sizeof(
float));
433 js->
buttons = calloc(buttonCount + hatCount * 4, 1);
434 js->
hats = calloc(hatCount, 1);
439 strcpy(js->
guid, guid);
498 "Invalid cursor mode 0x%08X",
611 return (
int) window->
keys[
key];
667 if (xpos != xpos || xpos < -DBL_MAX || xpos > DBL_MAX ||
668 ypos != ypos || ypos < -DBL_MAX || ypos > DBL_MAX)
671 "Invalid cursor position %f %f",
758 if (window->
cursor == cursor)
769 while (*prev != cursor)
770 prev = &((*prev)->next);
772 *prev = cursor->
next;
1088 if ((*c >=
'0' && *c <=
'9') ||
1089 (*c >=
'a' && *c <=
'f') ||
1090 (*c >=
'A' && *c <=
'F'))
1094 const size_t length = strcspn(c,
"\r\n");
1095 if (length <
sizeof(line))
1099 memcpy(line, c, length);
1122 c += strcspn(c,
"\r\n");
1123 c += strspn(c,
"\r\n");
1230 const unsigned int hat = e->
index >> 4;
1231 const unsigned int bit = e->
index & 0xf;
1232 if (js->
hats[hat] & bit)
1245 state->
axes[
i] = fminf(fmaxf(value, -1.
f), 1.
f);
1249 const unsigned int hat = e->
index >> 4;
1250 const unsigned int bit = e->
index & 0xf;
1251 if (js->
hats[hat] & bit)
1252 state->
axes[
i] = 1.f;
1286 if (time != time || time < 0.0 || time > 18446744073.0)
GLFWcursorposfun cursorPos
GLenum GLsizei const void * pointer
#define GLFW_GAMEPAD_AXIS_LEFT_Y
GLuint const GLchar * name
#define _GLFW_REQUIRE_INIT()
static GLFWwindow * window
GLFWmousebuttonfun mouseButton
GLuint64 GLenum void * handle
#define _GLFW_PLATFORM_MAPPING_NAME
#define _GLFW_POLL_PRESENCE
GLsizei const GLuint * paths
struct _GLFWwindow::@26 callbacks
GLFWcursorenterfun cursorEnter
uint64_t _glfwPlatformGetTimerFrequency(void)
char * _glfw_strdup(const char *source)
#define GLFW_CROSSHAIR_CURSOR
The crosshair shape.
GLsizei const GLchar *const * string
void _glfwPlatformSetClipboardString(const char *string)
const char * _glfwPlatformGetClipboardString(void)
#define GLFW_ARROW_CURSOR
The regular arrow cursor shape.
_GLFWwindow * windowListHead
GLenum GLenum GLsizei void * image
#define GLFW_GAMEPAD_AXIS_RIGHT_X
#define GLFW_CURSOR_DISABLED
#define _GLFW_SWAP_POINTERS(x, y)
_GLFWcursor * cursorListHead
#define GLFW_VRESIZE_CURSOR
The vertical resize arrow shape.
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
char keys[GLFW_KEY_LAST+1]
#define GLFW_CURSOR_NORMAL
struct _GLFWlibrary::@27 hints
GLFWbool stickyMouseButtons
#define GLFW_HAND_CURSOR
The hand shape.
#define _GLFW_POLL_BUTTONS
#define GLFW_JOYSTICK_LAST
struct _GLFWwindow * next
unsigned __int64 uint64_t
unsigned char buttons[15]
#define GLFW_GAMEPAD_AXIS_LEFT_X
GLenum GLenum GLenum GLenum mapping
void _glfwPlatformSetCursorPos(_GLFWwindow *window, double xpos, double ypos)
void _glfwInputError(int code, const char *format,...)
const char * _glfwPlatformGetScancodeName(int scancode)
#define GLFW_MOD_CAPS_LOCK
If this bit is set the Caps Lock key is enabled.
#define GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER
uint64_t _glfwPlatformGetTimerValue(void)
#define GLFW_INVALID_ENUM
One of the arguments to the function was an invalid enum value.
int _glfwPlatformWindowFocused(_GLFWwindow *window)
#define GLFW_INVALID_VALUE
One of the arguments to the function was an invalid value.
int _glfwPlatformCreateCursor(_GLFWcursor *cursor, const GLFWimage *image, int xhot, int yhot)
#define GLFW_GAMEPAD_AXIS_LAST
#define GLFW_CURSOR_HIDDEN
GLint GLint GLint yoffset
void _glfwPlatformGetCursorPos(_GLFWwindow *window, double *xpos, double *ypos)
#define GLFW_HRESIZE_CURSOR
The horizontal resize arrow shape.
#define GLFW_IBEAM_CURSOR
The text input I-beam cursor shape.
_GLFWmapelement buttons[15]
struct _GLFWlibrary::@28 timer
void _glfwPlatformSetCursorMode(_GLFWwindow *window, int mode)
#define GLFW_KEY_KP_EQUAL
struct _GLFWlibrary::@30 callbacks
int _glfwPlatformCreateStandardCursor(_GLFWcursor *cursor, int shape)
char mouseButtons[GLFW_MOUSE_BUTTON_LAST+1]
#define GLFW_LOCK_KEY_MODS
GLenum GLuint GLenum GLsizei length
int _glfwPlatformPollJoystick(_GLFWjoystick *js, int mode)
_GLFWjoystick joysticks[GLFW_JOYSTICK_LAST+1]
#define GLFW_STICKY_MOUSE_BUTTONS
#define GLFW_GAMEPAD_AXIS_RIGHT_Y
void _glfwPlatformUpdateGamepadGUID(char *guid)
void _glfwPlatformSetCursor(_GLFWwindow *window, _GLFWcursor *cursor)
void _glfwPlatformDestroyCursor(_GLFWcursor *cursor)
#define GLFW_GAMEPAD_AXIS_LEFT_TRIGGER
struct GLFWwindow GLFWwindow
#define GLFW_MOD_NUM_LOCK
If this bit is set the Num Lock key is enabled.
int _glfwPlatformGetKeyScancode(int key)