Skip to content

Commit

Permalink
pointing_device data-driven: fix schema, order, add extended_mouse_re…
Browse files Browse the repository at this point in the history
…port + motion_active_low
  • Loading branch information
Kriechi committed Aug 17, 2023
1 parent 49c6103 commit f0315be
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
1 change: 1 addition & 0 deletions data/mappings/info_config.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"MATRIX_IO_DELAY": {"info_key": "matrix_pins.io_delay", "value_type": "int"},

// Mouse Keys
"MOUSE_EXTENDED_REPORT": {"info_key": "pointing_device.extended_mouse_report", "value_type": "bool"},
"MOUSEKEY_DELAY": {"info_key": "mousekey.delay", "value_type": "int"},
"MOUSEKEY_INTERVAL": {"info_key": "mousekey.interval", "value_type": "int"},
"MOUSEKEY_MAX_SPEED": {"info_key": "mousekey.max_speed", "value_type": "int"},
Expand Down
45 changes: 23 additions & 22 deletions data/schemas/keyboard.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -420,21 +420,17 @@
"properties": {
"enabled": {"type": "boolean"},
"driver": {"type": "string"},
"auto_mouse": {
"type": "object",
"properties": {
"enabled": {"type": "boolean"},
"default_layer": {"type": "qmk.definitions.v1#/unsigned_int_8"},
"time": {"type": "qmk.definitions.v1#/unsigned_int"},
"delay": {"type": "qmk.definitions.v1#/unsigned_int"},
"debounce": {"type": "qmk.definitions.v1#/unsigned_int"}
}
}
"rotation": {
"type": "integer",
"minimum": 0,
"enum": [0, 90, 180, 270]
},
"pins": {
"type": "object",
"additionalProperties": false,
"properties": {
"motion": {"$ref": "qmk.definitions.v1#/mcu_pin"},
"motion_active_low": {"type": "boolean"},
"cs": {"$ref": "qmk.definitions.v1#/mcu_pin"},
"sdio": {"$ref": "qmk.definitions.v1#/mcu_pin"},
"sclk": {"$ref": "qmk.definitions.v1#/mcu_pin"}
Expand All @@ -450,10 +446,16 @@
"scroll": {"type": "boolean"}
}
},
"rotation": {
"type": "integer",
"minimum": 0,
"enum": [0, 90, 180, 270]
"extended_mouse_report": {"type": "boolean"},
"auto_mouse": {
"type": "object",
"properties": {
"enabled": {"type": "boolean"},
"default_layer": {"type": "qmk.definitions.v1#/unsigned_int_8"},
"time": {"type": "qmk.definitions.v1#/unsigned_int"},
"delay": {"type": "qmk.definitions.v1#/unsigned_int"},
"debounce": {"type": "qmk.definitions.v1#/unsigned_int"}
}
}
}
},
Expand Down Expand Up @@ -666,22 +668,21 @@
"enum": ["eeprom", "left", "matrix_grid", "pin", "right"]
},
"pointing_device": {
"side": {
"type": "string",
"enum": ["left", "right", "combined"]
},
"right": {
"type": "object",
"additionalProperties": false,
"type": "object",
"properties": {
"side": {
"type": "string",
"enum": ["left", "right", "combined"]
},
"invert_x": {"type": "boolean"},
"invert_y": {"type": "boolean"},
"rotation": {
"type": "integer",
"minimum": 0,
"enum": [0, 90, 180, 270]
}
},
"invert_x": {"type": "boolean"},
"invert_y": {"type": "boolean"}
}
}
},
Expand Down
7 changes: 4 additions & 3 deletions lib/python/qmk/cli/generate/config_h.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ def generate_encoder_config(encoder_json, config_h_lines, postfix=''):


def generate_pointing_device_config(pointing_device_json, config_h_lines, postfix=''):

rotation = pointing_device_json.get('rotation', 0)

generate_define(f'POINTING_DEVICE_ROTATION_{rotation}{postfix}')
config_h_lines.append(generate_define(f'POINTING_DEVICE_ROTATION_{rotation}{postfix}'))


def generate_split_config(kb_info_json, config_h_lines):
Expand Down Expand Up @@ -165,6 +163,9 @@ def generate_split_config(kb_info_json, config_h_lines):
if 'right' in kb_info_json['split'].get('encoder', {}):
generate_encoder_config(kb_info_json['split']['encoder']['right'], config_h_lines, '_RIGHT')

if 'side' in kb_info_json['split'].get('pointing_device', {}):
s = kb_info_json['split']['pointing_device']['side']
config_h_lines.append(generate_define('POINTING_DEVICE_' + s.upper()))
if 'right' in kb_info_json['split'].get('pointing_device', {}):
generate_pointing_device_config(kb_info_json['split']['pointing_device']['right'], config_h_lines, '_RIGHT')

Expand Down

0 comments on commit f0315be

Please sign in to comment.