|
41 | 41 | #define CLEVO_EVENT_RFKILL1 0x85
|
42 | 42 | #define CLEVO_EVENT_RFKILL2 0x86
|
43 | 43 |
|
| 44 | +#define CLEVO_EVENT_GAUGE_KEY 0x59 |
| 45 | + |
44 | 46 | #define CLEVO_KB_MODE_DEFAULT 0 // "CUSTOM"/Static Color
|
45 | 47 |
|
46 | 48 | static struct clevo_interfaces_t {
|
@@ -248,27 +250,35 @@ static u8 param_kbd_backlight_mode = CLEVO_KB_MODE_DEFAULT;
|
248 | 250 | module_param_cb(kbd_backlight_mode, ¶m_ops_mode_ops, ¶m_kbd_backlight_mode, S_IRUSR);
|
249 | 251 | MODULE_PARM_DESC(kbd_backlight_mode, "Set the keyboard backlight mode");
|
250 | 252 |
|
| 253 | +static void clevo_send_cc_combo(void) |
| 254 | +{ |
| 255 | + // Special key combination. Opens TCC by default when installed. |
| 256 | + input_report_key(clevo_keyboard_driver.input_device, KEY_LEFTMETA, 1); |
| 257 | + input_report_key(clevo_keyboard_driver.input_device, KEY_LEFTALT, 1); |
| 258 | + input_report_key(clevo_keyboard_driver.input_device, KEY_F6, 1); |
| 259 | + input_sync(clevo_keyboard_driver.input_device); |
| 260 | + input_report_key(clevo_keyboard_driver.input_device, KEY_F6, 0); |
| 261 | + input_report_key(clevo_keyboard_driver.input_device, KEY_LEFTALT, 0); |
| 262 | + input_report_key(clevo_keyboard_driver.input_device, KEY_LEFTMETA, 0); |
| 263 | + input_sync(clevo_keyboard_driver.input_device); |
| 264 | +} |
| 265 | + |
251 | 266 | static void clevo_keyboard_event_callb(u32 event)
|
252 | 267 | {
|
253 | 268 | u32 key_event = event;
|
254 | 269 |
|
255 | 270 | TUXEDO_DEBUG("Clevo event: %0#6x\n", event);
|
256 | 271 |
|
257 | 272 | switch (key_event) {
|
| 273 | + case CLEVO_EVENT_GAUGE_KEY: |
| 274 | + clevo_send_cc_combo(); |
| 275 | + break; |
258 | 276 | case CLEVO_EVENT_KB_LEDS_CYCLE_MODE:
|
259 |
| - if (clevo_leds_get_backlight_type() == CLEVO_KB_BACKLIGHT_TYPE_FIXED_COLOR) { |
260 |
| - // Special key combination. Opens TCC by default when installed. |
261 |
| - input_report_key(clevo_keyboard_driver.input_device, KEY_LEFTMETA, 1); |
262 |
| - input_report_key(clevo_keyboard_driver.input_device, KEY_LEFTALT, 1); |
263 |
| - input_report_key(clevo_keyboard_driver.input_device, KEY_F6, 1); |
264 |
| - input_sync(clevo_keyboard_driver.input_device); |
265 |
| - input_report_key(clevo_keyboard_driver.input_device, KEY_F6, 0); |
266 |
| - input_report_key(clevo_keyboard_driver.input_device, KEY_LEFTALT, 0); |
267 |
| - input_report_key(clevo_keyboard_driver.input_device, KEY_LEFTMETA, 0); |
268 |
| - input_sync(clevo_keyboard_driver.input_device); |
269 |
| - } else { |
270 |
| - set_next_color_whole_kb(); |
271 |
| - } |
| 277 | + if (clevo_leds_get_backlight_type() == CLEVO_KB_BACKLIGHT_TYPE_FIXED_COLOR) { |
| 278 | + clevo_send_cc_combo(); |
| 279 | + } else { |
| 280 | + set_next_color_whole_kb(); |
| 281 | + } |
272 | 282 | break;
|
273 | 283 | case CLEVO_EVENT_KB_LEDS_CYCLE_BRIGHTNESS:
|
274 | 284 | clevo_leds_notify_brightness_change_extern();
|
|
0 commit comments