mirror of
https://github.com/swaywm/sway.git
synced 2025-11-13 13:29:49 -05:00
sway input device
This commit is contained in:
parent
462a451328
commit
163edc5a90
14 changed files with 258 additions and 215 deletions
|
|
@ -226,6 +226,34 @@ static int qstrcmp(const void* a, const void* b) {
|
|||
return strcmp(*((char**) a), *((char**) b));
|
||||
}
|
||||
|
||||
struct input_config *new_input_config(const char* identifier) {
|
||||
struct input_config *input = calloc(1, sizeof(struct input_config));
|
||||
if (!input) {
|
||||
sway_log(L_DEBUG, "Unable to allocate input config");
|
||||
return NULL;
|
||||
}
|
||||
sway_log(L_DEBUG, "new_input_config(%s)", identifier);
|
||||
if (!(input->identifier = strdup(identifier))) {
|
||||
free(input);
|
||||
sway_log(L_DEBUG, "Unable to allocate input config");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
input->tap = INT_MIN;
|
||||
input->drag_lock = INT_MIN;
|
||||
input->dwt = INT_MIN;
|
||||
input->send_events = INT_MIN;
|
||||
input->click_method = INT_MIN;
|
||||
input->middle_emulation = INT_MIN;
|
||||
input->natural_scroll = INT_MIN;
|
||||
input->accel_profile = INT_MIN;
|
||||
input->pointer_accel = FLT_MIN;
|
||||
input->scroll_method = INT_MIN;
|
||||
input->left_handed = INT_MIN;
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
void merge_input_config(struct input_config *dst, struct input_config *src) {
|
||||
if (src->identifier) {
|
||||
if (dst->identifier) {
|
||||
|
|
@ -453,6 +481,7 @@ bool load_include_configs(const char *path, struct sway_config *config) {
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool read_config(FILE *file, struct sway_config *config) {
|
||||
bool success = true;
|
||||
enum cmd_status block = CMD_BLOCK_END;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue