[client] Move default input config to its own file

This makes it much easier to maintain the config.
This commit is contained in:
Bill Currie 2021-11-25 20:02:48 +09:00
parent b01c38903d
commit 70c2fdce9e
3 changed files with 143 additions and 33 deletions

View file

@ -9,3 +9,8 @@ libs_client_libQFclient_la_SOURCES= \
libs/client/cl_temp_entities.c \ libs/client/cl_temp_entities.c \
libs/client/locs.c \ libs/client/locs.c \
libs/client/old_keys.c libs/client/old_keys.c
default_input_src = libs/client/default_input.plist
default_input_gen = libs/client/default_input.plc
libs/client/cl_input.lo: libs/client/cl_input.c $(default_input_gen)

View file

@ -41,39 +41,9 @@
#include "client/input.h" #include "client/input.h"
static const char *default_input_config = "" static const char default_input_config[] = {
"{" #include "libs/client/default_input.plc"
" input = {" };
" contexts = ("
" {"
" name = key_game;"
" imts = ("
" {"
" name = imt_mod;"
" }"
" );"
" default_imt = imt_mod;"
" },"
" {"
" name = key_demo;"
" }"
" );"
" devices = ("
" {"
" name = mouse;"
" devname = core:mouse;"
" num_axes = 2;"
" num_buttons = 32;"
" },"
" {"
" name = key;"
" devname = core:keyboard;"
" num_axes = 0;"
" num_buttons = 256;"
" },"
" );"
" };"
"};";
static void static void
cl_bind_f (void) cl_bind_f (void)

View file

@ -0,0 +1,135 @@
{
input = {
contexts = (
{
name = key_game;
imts = (
{
name = imt_mod;
},
{
name = imt_mod_strafe;
chain = imt_mod;
},
{
name = imt_mod_freelook;
chain = imt_mod;
},
{
name = imt_mod_lookstrafe;
chain = imt_mod_freelook;
}
);
default_imt = imt_mod;
switchers = (
{
name = mouse;
inputs = (
+strafe,
lookstrafe,
+mlook,
freelook
);
imts = (
imt_mod,
imt_mod_strafe,
imt_mod,
imt_mod_strafe,
imt_mod_freelook,
imt_mod_strafe,
imt_mod_lookstrafe,
imt_mod_strafe,
imt_mod_freelook,
imt_mod_strafe,
imt_mod_lookstrafe,
imt_mod_strafe,
imt_mod_freelook,
imt_mod_strafe,
imt_mod_lookstrafe,
imt_mod_strafe
);
}
);
},
{
name = key_demo;
}
);
devices = (
{
name = mouse;
devname = core:mouse;
num_axes = 2;
num_buttons = 32;
axes = (
{
imt = imt_mod;
num = 0;
axis = move.yaw;
min = 0;
max = 0;
minzone = 0;
maxzone = 0;
deadzone = 0;
curve = 1;
scale = 1;
},
{
imt = imt_mod_strafe;
num = 0;
axis = move.side;
min = 0;
max = 0;
minzone = 0;
maxzone = 0;
deadzone = 0;
curve = 1;
scale = 1;
},
{
imt = imt_mod_lookstrafe;
num = 0;
axis = move.side;
min = 0;
max = 0;
minzone = 0;
maxzone = 0;
deadzone = 0;
curve = 1;
scale = 1;
},
{
imt = imt_mod;
num = 1;
axis = move.forward;
min = 0;
max = 0;
minzone = 0;
maxzone = 0;
deadzone = 0;
curve = 1;
scale = 1;
},
{
imt = imt_mod_freelook;
num = 1;
axis = move.pitch;
min = 0;
max = 0;
minzone = 0;
maxzone = 0;
deadzone = 0;
curve = 1;
scale = 1;
}
);
},
{
name = key;
devname = core:keyboard;
num_axes = 0;
num_buttons = 256;
}
);
};
}