56 lines
3.1 KiB
Plaintext
56 lines
3.1 KiB
Plaintext
module sdl3::sdl;
|
|
|
|
typedef KeyboardID = uint;
|
|
|
|
extern fn bool has_keyboard() @extern("SDL_HasKeyboard");
|
|
extern fn KeyboardID* get_keyboards(int *count) @extern("SDL_GetKeyboards");
|
|
extern fn ZString get_keyboard_name_for_id(KeyboardID instance_id) @extern("SDL_GetKeyboardNameForID");
|
|
extern fn Window* get_keyboard_focus() @extern("SDL_GetKeyboardFocus");
|
|
extern fn bool* get_keyboard_state(int *numkeys) @extern("SDL_GetKeyboardState");
|
|
extern fn void reset_keyboard() @extern("SDL_ResetKeyboard");
|
|
extern fn Keymod get_mod_state() @extern("SDL_GetModState");
|
|
extern fn void set_mod_state(Keymod modstate) @extern("SDL_SetModState");
|
|
extern fn Keycode get_key_from_scancode(Scancode scancode, Keymod modstate, bool key_event) @extern("SDL_GetKeyFromScancode");
|
|
extern fn Scancode get_scancode_from_key(Keycode key, Keymod *modstate) @extern("SDL_GetScancodeFromKey");
|
|
extern fn bool set_scancode_name(Scancode scancode, ZString name) @extern("SDL_SetScancodeName");
|
|
extern fn ZString get_scancode_name(Scancode scancode) @extern("SDL_GetScancodeName");
|
|
extern fn Scancode get_scancode_from_name(ZString name) @extern("SDL_GetScancodeFromName");
|
|
extern fn ZString get_key_name(Keycode key) @extern("SDL_GetKeyName");
|
|
extern fn Keycode get_key_from_name(ZString name) @extern("SDL_GetKeyFromName");
|
|
extern fn bool start_text_input(Window* window) @extern("SDL_StartTextInput");
|
|
|
|
enum TextInputType : inline CInt {
|
|
SDL_TEXTINPUT_TYPE_TEXT,
|
|
SDL_TEXTINPUT_TYPE_TEXT_NAME,
|
|
SDL_TEXTINPUT_TYPE_TEXT_EMAIL,
|
|
SDL_TEXTINPUT_TYPE_TEXT_USERNAME,
|
|
SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN,
|
|
SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE,
|
|
SDL_TEXTINPUT_TYPE_NUMBER,
|
|
SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN,
|
|
SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE
|
|
}
|
|
|
|
enum Capitalization : inline CInt {
|
|
SDL_CAPITALIZE_NONE,
|
|
SDL_CAPITALIZE_SENTENCES,
|
|
SDL_CAPITALIZE_WORDS,
|
|
SDL_CAPITALIZE_LETTERS
|
|
}
|
|
|
|
extern fn bool start_text_input_with_properties(Window* window, PropertiesID props) @extern("SDL_StartTextInputWithProperties");
|
|
|
|
const ZString PROP_TEXTINPUT_TYPE_NUMBER @builtin = "SDL.textinput.type";
|
|
const ZString PROP_TEXTINPUT_CAPITALIZATION_NUMBER @builtin = "SDL.textinput.capitalization";
|
|
const ZString PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN @builtin = "SDL.textinput.autocorrect";
|
|
const ZString PROP_TEXTINPUT_MULTILINE_BOOLEAN @builtin = "SDL.textinput.multiline";
|
|
const ZString PROP_TEXTINPUT_ANDROID_INPUTTYPE_NUMBER @builtin = "SDL.textinput.android.inputtype";
|
|
|
|
extern fn bool text_input_active(Window* window) @extern("SDL_TextInputActive");
|
|
extern fn bool stop_text_input(Window* window) @extern("SDL_StopTextInput");
|
|
extern fn bool clear_composition(Window* window) @extern("SDL_ClearComposition");
|
|
extern fn bool set_text_input_area(Window* window, Rect* rect, int cursor) @extern("SDL_SetTextInputArea");
|
|
extern fn bool get_text_input_area(Window* window, Rect* rect, int *cursor) @extern("SDL_GetTextInputArea");
|
|
extern fn bool has_screen_keyboard_support() @extern("SDL_HasScreenKeyboardSupport");
|
|
extern fn bool screen_keyboard_shown(Window* window) @extern("SDL_ScreenKeyboardShown");
|