Browse Source

Adding GetKeyName(int key) (WIP) (#4161)

pull/4169/head
MrScautHD 7 months ago
committed by GitHub
parent
commit
576bee5cce
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
7 changed files with 47 additions and 0 deletions
  1. +7
    -0
      src/platforms/rcore_android.c
  2. +6
    -0
      src/platforms/rcore_desktop_glfw.c
  3. +7
    -0
      src/platforms/rcore_desktop_rgfw.c
  4. +6
    -0
      src/platforms/rcore_desktop_sdl.c
  5. +7
    -0
      src/platforms/rcore_drm.c
  6. +7
    -0
      src/platforms/rcore_template.c
  7. +7
    -0
      src/platforms/rcore_web.c

+ 7
- 0
src/platforms/rcore_android.c View File

@ -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)
{

+ 6
- 0
src/platforms/rcore_desktop_glfw.c View File

@ -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)
{

+ 7
- 0
src/platforms/rcore_desktop_rgfw.c View File

@ -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

+ 6
- 0
src/platforms/rcore_desktop_sdl.c View File

@ -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);

+ 7
- 0
src/platforms/rcore_drm.c View File

@ -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)
{

+ 7
- 0
src/platforms/rcore_template.c View File

@ -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)
{

+ 7
- 0
src/platforms/rcore_web.c View File

@ -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)
{

Loading…
Cancel
Save