diff options
Diffstat (limited to 'src/rcore_custom.c')
| -rw-r--r-- | src/rcore_custom.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/rcore_custom.c b/src/rcore_custom.c index 933f222f..e17aa96b 100644 --- a/src/rcore_custom.c +++ b/src/rcore_custom.c @@ -563,17 +563,10 @@ void OpenURL(const char *url) // Module Functions Definition: Inputs //---------------------------------------------------------------------------------- -// Set a custom key to exit program -void SetExitKey(int key) -{ - TRACELOG(LOG_WARNING, "SetExitKey() not implemented on target platform"); -} - // Get gamepad internal name id const char *GetGamepadName(int gamepad) { - TRACELOG(LOG_WARNING, "GetGamepadName() not implemented on target platform"); - return NULL; + return CORE.Input.Gamepad.name[gamepad]; } // Get gamepad axis count @@ -592,19 +585,25 @@ int SetGamepadMappings(const char *mappings) // Get mouse position X int GetMouseX(void) { - return (int)CORE.Input.Touch.position[0].x; + return (int)((CORE.Input.Mouse.currentPosition.x + CORE.Input.Mouse.offset.x)*CORE.Input.Mouse.scale.x); } // Get mouse position Y int GetMouseY(void) { - return (int)CORE.Input.Touch.position[0].y; + return (int)((CORE.Input.Mouse.currentPosition.y + CORE.Input.Mouse.offset.y)*CORE.Input.Mouse.scale.y); } // Get mouse position XY Vector2 GetMousePosition(void) { - return GetTouchPosition(0); + Vector2 position = { 0 }; + + // NOTE: On canvas scaling, mouse position is proportionally returned + position.x = (CORE.Input.Mouse.currentPosition.x + CORE.Input.Mouse.offset.x)*CORE.Input.Mouse.scale.x; + position.y = (CORE.Input.Mouse.currentPosition.y + CORE.Input.Mouse.offset.y)*CORE.Input.Mouse.scale.y; + + return position; } // Set mouse position XY |
