Skip to content

Commit

Permalink
Adding GetKeyName(int key) (WIP) (#4161)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrScautHD committed Jul 16, 2024
1 parent 5ede476 commit 576bee5
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/platforms/rcore_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,13 @@ void SetMouseCursor(int cursor)
TRACELOG(LOG_WARNING, "SetMouseCursor() not implemented on target platform");
}

// Get physical key name.
const char *GetKeyName(int key)
{
TRACELOG(LOG_WARNING, "GetKeyName() not implemented on target platform");
return "";
}

// Register all input events
void PollInputEvents(void)
{
Expand Down
6 changes: 6 additions & 0 deletions src/platforms/rcore_desktop_glfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,12 @@ void SetMouseCursor(int cursor)
}
}

// Get physical key name.
const char *GetKeyName(int key)
{
return glfwGetKeyName(key, glfwGetKeyScancode(key));
}

// Register all input events
void PollInputEvents(void)
{
Expand Down
7 changes: 7 additions & 0 deletions src/platforms/rcore_desktop_rgfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,13 @@ void SetMouseCursor(int cursor)
RGFW_window_setMouseStandard(platform.window, cursor);
}

// Get physical key name.
const char *GetKeyName(int key)
{
TRACELOG(LOG_WARNING, "GetKeyName() not implemented on target platform");
return "";
}

static KeyboardKey ConvertScancodeToKey(u32 keycode);

// TODO: Review function to avoid duplicate with RSGL
Expand Down
6 changes: 6 additions & 0 deletions src/platforms/rcore_desktop_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,12 @@ void SetMouseCursor(int cursor)
CORE.Input.Mouse.cursor = cursor;
}

// Get physical key name.
const char *GetKeyName(int key)
{
return SDL_GetKeyName(key);
}

static void UpdateTouchPointsSDL(SDL_TouchFingerEvent event)
{
CORE.Input.Touch.pointCount = SDL_GetNumTouchFingers(event.touchId);
Expand Down
7 changes: 7 additions & 0 deletions src/platforms/rcore_drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,13 @@ void SetMouseCursor(int cursor)
TRACELOG(LOG_WARNING, "SetMouseCursor() not implemented on target platform");
}

// Get physical key name.
const char *GetKeyName(int key)
{
TRACELOG(LOG_WARNING, "GetKeyName() not implemented on target platform");
return "";
}

// Register all input events
void PollInputEvents(void)
{
Expand Down
7 changes: 7 additions & 0 deletions src/platforms/rcore_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,13 @@ void SetMouseCursor(int cursor)
TRACELOG(LOG_WARNING, "SetMouseCursor() not implemented on target platform");
}

// Get physical key name.
const char *GetKeyName(int key)
{
TRACELOG(LOG_WARNING, "GetKeyName() not implemented on target platform");
return "";
}

// Register all input events
void PollInputEvents(void)
{
Expand Down
7 changes: 7 additions & 0 deletions src/platforms/rcore_web.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,13 @@ void SetMouseCursor(int cursor)
}
}

// Get physical key name.
const char *GetKeyName(int key)
{
TRACELOG(LOG_WARNING, "GetKeyName() not implemented on target platform");
return "";
}

// Register all input events
void PollInputEvents(void)
{
Expand Down

0 comments on commit 576bee5

Please sign in to comment.