add gamepad type grabbing
This commit is contained in:
@@ -733,6 +733,11 @@ JSC_CCALL(input_get_events,
|
||||
return events_array;
|
||||
)
|
||||
|
||||
JSC_CCALL(input_gamepad_id_to_type,
|
||||
int id = js2number(js, argv[0]);
|
||||
return JS_NewString(js, SDL_GetGamepadStringForType(SDL_GetGamepadTypeForID(id)));
|
||||
)
|
||||
|
||||
static const JSCFunctionListEntry js_input_funcs[] = {
|
||||
MIST_FUNC_DEF(input, mouse_show, 1),
|
||||
MIST_FUNC_DEF(input, mouse_lock, 1),
|
||||
@@ -740,6 +745,7 @@ static const JSCFunctionListEntry js_input_funcs[] = {
|
||||
MIST_FUNC_DEF(input, keymod, 0),
|
||||
MIST_FUNC_DEF(input, mousestate, 0),
|
||||
MIST_FUNC_DEF(input, get_events, 0),
|
||||
MIST_FUNC_DEF(input, gamepad_id_to_type, 1),
|
||||
};
|
||||
|
||||
JSValue js_input_use(JSContext *js) {
|
||||
|
||||
Reference in New Issue
Block a user