Add support for button glyph display
This adds a function that converts an action (such as interacting
in-game) to the corresponding button text ("ENTER", "E") or button
glyph (PlayStation triangle, Steam Deck Y, etc). This function
currently only gives the existing ENTERs or Es, because I don't know
how best to detect controller usage, or whether the game is running on
a Steam Deck, or what buttons need to be displayed there. Still, it
should now be really easy to adapt the rendering of keyboard keys to
consoles, controllers, or rebound keys.
To identify the actions that currently need to be displayed, this
commit also adds the initial enums for action sets as described by
Ethan in a comment in #834 (Jan 18, 2022).
2023-03-18 22:30:16 +01:00
|
|
|
#ifndef BUTTONGLYPHS_H
|
|
|
|
#define BUTTONGLYPHS_H
|
|
|
|
|
2023-03-13 04:16:36 +01:00
|
|
|
#include <SDL.h>
|
Add support for button glyph display
This adds a function that converts an action (such as interacting
in-game) to the corresponding button text ("ENTER", "E") or button
glyph (PlayStation triangle, Steam Deck Y, etc). This function
currently only gives the existing ENTERs or Es, because I don't know
how best to detect controller usage, or whether the game is running on
a Steam Deck, or what buttons need to be displayed there. Still, it
should now be really easy to adapt the rendering of keyboard keys to
consoles, controllers, or rebound keys.
To identify the actions that currently need to be displayed, this
commit also adds the initial enums for action sets as described by
Ethan in a comment in #834 (Jan 18, 2022).
2023-03-18 22:30:16 +01:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#include "ActionSets.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void BUTTONGLYPHS_init(void);
|
|
|
|
|
|
|
|
bool BUTTONGLYPHS_keyboard_is_available(void);
|
|
|
|
bool BUTTONGLYPHS_keyboard_is_active(void);
|
2023-03-20 02:12:49 +01:00
|
|
|
void BUTTONGLYPHS_keyboard_set_active(bool active);
|
|
|
|
|
2023-08-22 15:52:53 +02:00
|
|
|
void BUTTONGLYPHS_update_layout(Uint16 vendor, Uint16 product);
|
|
|
|
|
Add support for button glyph display
This adds a function that converts an action (such as interacting
in-game) to the corresponding button text ("ENTER", "E") or button
glyph (PlayStation triangle, Steam Deck Y, etc). This function
currently only gives the existing ENTERs or Es, because I don't know
how best to detect controller usage, or whether the game is running on
a Steam Deck, or what buttons need to be displayed there. Still, it
should now be really easy to adapt the rendering of keyboard keys to
consoles, controllers, or rebound keys.
To identify the actions that currently need to be displayed, this
commit also adds the initial enums for action sets as described by
Ethan in a comment in #834 (Jan 18, 2022).
2023-03-18 22:30:16 +01:00
|
|
|
const char* BUTTONGLYPHS_get_wasd_text(void);
|
2023-03-13 04:16:36 +01:00
|
|
|
const char* BUTTONGLYPHS_get_button(ActionSet actionset, Action action, int binding);
|
|
|
|
|
|
|
|
char* BUTTONGLYPHS_get_all_gamepad_buttons(
|
|
|
|
char* buffer,
|
|
|
|
size_t buffer_len,
|
|
|
|
ActionSet actionset,
|
|
|
|
int action
|
|
|
|
);
|
Add support for button glyph display
This adds a function that converts an action (such as interacting
in-game) to the corresponding button text ("ENTER", "E") or button
glyph (PlayStation triangle, Steam Deck Y, etc). This function
currently only gives the existing ENTERs or Es, because I don't know
how best to detect controller usage, or whether the game is running on
a Steam Deck, or what buttons need to be displayed there. Still, it
should now be really easy to adapt the rendering of keyboard keys to
consoles, controllers, or rebound keys.
To identify the actions that currently need to be displayed, this
commit also adds the initial enums for action sets as described by
Ethan in a comment in #834 (Jan 18, 2022).
2023-03-18 22:30:16 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} // extern "C"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // BUTTONGLYPHS_H
|