From e5a45fe755a077c12e28194569ca9d646b9b1328 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Tue, 14 Jan 2025 21:55:26 +1100 Subject: [PATCH] Move lighting keycodes to new tab --- src/components/Keycodes.vue | 2 +- src/i18n/de.csv | 1 + src/i18n/en.csv | 1 + src/i18n/es.csv | 1 + src/i18n/fr.csv | 1 + src/i18n/it.csv | 1 + src/i18n/ja.csv | 1 + src/i18n/ms.csv | 1 + src/i18n/pl-PL.csv | 1 + src/i18n/pt-BR.csv | 1 + src/i18n/ru.csv | 1 + src/i18n/zh-CN.csv | 1 + src/i18n/zh-HK.csv | 1 + src/i18n/zh-TW.csv | 1 + src/i18n/zh.csv | 1 + src/longFormKeycodes.js | 25 ++--- src/store/keycodes.js | 8 +- src/store/modules/keycodes/kb-settings.js | 74 +-------------- src/store/modules/keycodes/lighting.js | 111 ++++++++++++++++++++++ 19 files changed, 147 insertions(+), 87 deletions(-) create mode 100644 src/store/modules/keycodes/lighting.js diff --git a/src/components/Keycodes.vue b/src/components/Keycodes.vue index c69196b154..5f78d020b5 100644 --- a/src/components/Keycodes.vue +++ b/src/components/Keycodes.vue @@ -167,7 +167,7 @@ export default { } .tabs { display: grid; - grid-template: auto / repeat(6, minmax(120px, 200px)); + grid-template: auto / repeat(6, minmax(60px, 200px)); } .tab { text-overflow: ellipsis; diff --git a/src/i18n/de.csv b/src/i18n/de.csv index e4d80429eb..ba6080e7dd 100644 --- a/src/i18n/de.csv +++ b/src/i18n/de.csv @@ -46,6 +46,7 @@ keycodesTab:ANSI:label,ANSI keycodesTab:AppMediaMouse:label,"App, Media und Maus" keycodesTab:ISO/JIS:label,ISO/JIS keycodesTab:KeyboardSettings:label,Tastatureinstellungen +keycodesTab:Lighting:label, keycodesTab:Quantum:label,Quantum keycodesTab:Steno:label, keymap:label,Tastenbelegung diff --git a/src/i18n/en.csv b/src/i18n/en.csv index 7de4d12b1a..ecd0772ba5 100644 --- a/src/i18n/en.csv +++ b/src/i18n/en.csv @@ -46,6 +46,7 @@ keycodesTab:ANSI:label,ANSI keycodesTab:AppMediaMouse:label,"App, Media and Mouse" keycodesTab:ISO/JIS:label,ISO/JIS keycodesTab:KeyboardSettings:label,Keyboard Settings +keycodesTab:Lighting:label,Lighting keycodesTab:Quantum:label,Quantum keycodesTab:Steno:label,Steno keymap:label,Keymap diff --git a/src/i18n/es.csv b/src/i18n/es.csv index bd97263d29..593f2ce7e2 100644 --- a/src/i18n/es.csv +++ b/src/i18n/es.csv @@ -46,6 +46,7 @@ keycodesTab:ANSI:label,ANSI keycodesTab:AppMediaMouse:label,"App, Media y Mouse" keycodesTab:ISO/JIS:label,ISO/JIS keycodesTab:KeyboardSettings:label,Configuración de teclado +keycodesTab:Lighting:label, keycodesTab:Quantum:label,Quantum keycodesTab:Steno:label, keymap:label,Keymap diff --git a/src/i18n/fr.csv b/src/i18n/fr.csv index 1eb1d6c361..6ffd21c364 100644 --- a/src/i18n/fr.csv +++ b/src/i18n/fr.csv @@ -46,6 +46,7 @@ keycodesTab:ANSI:label,ANSI keycodesTab:AppMediaMouse:label,"Apps, Médias et Souris" keycodesTab:ISO/JIS:label,ISO/JIS keycodesTab:KeyboardSettings:label,Paramètres du clavier +keycodesTab:Lighting:label, keycodesTab:Quantum:label,Quantum keycodesTab:Steno:label,Sténo keymap:label,Disposition diff --git a/src/i18n/it.csv b/src/i18n/it.csv index 7bb0c8b3c8..8a04539e2f 100644 --- a/src/i18n/it.csv +++ b/src/i18n/it.csv @@ -46,6 +46,7 @@ keycodesTab:ANSI:label,ANSI keycodesTab:AppMediaMouse:label,"App, Media e Mouse" keycodesTab:ISO/JIS:label,ISO/JIS keycodesTab:KeyboardSettings:label,Configurazione Tastiera +keycodesTab:Lighting:label, keycodesTab:Quantum:label,Quantum keycodesTab:Steno:label,Steno keymap:label,Keymap diff --git a/src/i18n/ja.csv b/src/i18n/ja.csv index 950d1c3a9f..bf8b51bb51 100644 --- a/src/i18n/ja.csv +++ b/src/i18n/ja.csv @@ -46,6 +46,7 @@ keycodesTab:ANSI:label,ANSI keycodesTab:AppMediaMouse:label,"App, Media and Mouse" keycodesTab:ISO/JIS:label,ISO/JIS keycodesTab:KeyboardSettings:label,Keyboard Settings +keycodesTab:Lighting:label, keycodesTab:Quantum:label,Quantum keycodesTab:Steno:label, keymap:label,Keymap diff --git a/src/i18n/ms.csv b/src/i18n/ms.csv index fedbfc5970..f358cc72f1 100644 --- a/src/i18n/ms.csv +++ b/src/i18n/ms.csv @@ -46,6 +46,7 @@ keycodesTab:ANSI:label,ANSI keycodesTab:AppMediaMouse:label,"App, Media and Tetikus" keycodesTab:ISO/JIS:label,ISO/JIS keycodesTab:KeyboardSettings:label,Seting papan kekunci +keycodesTab:Lighting:label, keycodesTab:Quantum:label,Quantum keycodesTab:Steno:label, keymap:label,Keymap diff --git a/src/i18n/pl-PL.csv b/src/i18n/pl-PL.csv index 9b7fb20287..266834448a 100644 --- a/src/i18n/pl-PL.csv +++ b/src/i18n/pl-PL.csv @@ -46,6 +46,7 @@ keycodesTab:ANSI:label,ANSI keycodesTab:AppMediaMouse:label,"Aplikacje, Mysz i Multimedia" keycodesTab:ISO/JIS:label,ISO/JIS keycodesTab:KeyboardSettings:label,Ustawienia klawiatury +keycodesTab:Lighting:label, keycodesTab:Quantum:label,Quantum keycodesTab:Steno:label, keymap:label,Mapa klawiszy diff --git a/src/i18n/pt-BR.csv b/src/i18n/pt-BR.csv index a2047735d4..94fdf405fa 100644 --- a/src/i18n/pt-BR.csv +++ b/src/i18n/pt-BR.csv @@ -46,6 +46,7 @@ keycodesTab:ANSI:label,ANSI keycodesTab:AppMediaMouse:label,"App, Midia e Mouse" keycodesTab:ISO/JIS:label,ISO/JIS keycodesTab:KeyboardSettings:label,Configurações de teclado +keycodesTab:Lighting:label, keycodesTab:Quantum:label,Quantum keycodesTab:Steno:label, keymap:label,Keymap diff --git a/src/i18n/ru.csv b/src/i18n/ru.csv index 9b91276982..83b0670766 100644 --- a/src/i18n/ru.csv +++ b/src/i18n/ru.csv @@ -46,6 +46,7 @@ keycodesTab:ANSI:label,ANSI keycodesTab:AppMediaMouse:label,"Приложение, медиа и мышь" keycodesTab:ISO/JIS:label,ISO/JIS keycodesTab:KeyboardSettings:label,Настройки клавиатуры +keycodesTab:Lighting:label, keycodesTab:Quantum:label,Quantum keycodesTab:Steno:label, keymap:label,Раскладка diff --git a/src/i18n/zh-CN.csv b/src/i18n/zh-CN.csv index b5d4ee211a..1c31412923 100644 --- a/src/i18n/zh-CN.csv +++ b/src/i18n/zh-CN.csv @@ -46,6 +46,7 @@ keycodesTab:ANSI:label,ANSI keycodesTab:AppMediaMouse:label,应用、多媒体和鼠标 keycodesTab:ISO/JIS:label,ISO/JIS keycodesTab:KeyboardSettings:label,键盘设置 +keycodesTab:Lighting:label, keycodesTab:Quantum:label,量子 keycodesTab:Steno:label, keymap:label,键位 diff --git a/src/i18n/zh-HK.csv b/src/i18n/zh-HK.csv index b038bb6b9c..1336d7a24f 100644 --- a/src/i18n/zh-HK.csv +++ b/src/i18n/zh-HK.csv @@ -46,6 +46,7 @@ keycodesTab:ANSI:label,ANSI keycodesTab:AppMediaMouse:label,應用、多媒體和鼠標 keycodesTab:ISO/JIS:label,ISO/JIS keycodesTab:KeyboardSettings:label,鍵盤設置 +keycodesTab:Lighting:label, keycodesTab:Quantum:label,量子 keycodesTab:Steno:label, keymap:label,鍵位 diff --git a/src/i18n/zh-TW.csv b/src/i18n/zh-TW.csv index 2086dd5adc..43f46bc368 100644 --- a/src/i18n/zh-TW.csv +++ b/src/i18n/zh-TW.csv @@ -46,6 +46,7 @@ keycodesTab:ANSI:label,ANSI keycodesTab:AppMediaMouse:label,應用、多媒體和滑鼠 keycodesTab:ISO/JIS:label,ISO/JIS keycodesTab:KeyboardSettings:label,鍵盤設定 +keycodesTab:Lighting:label, keycodesTab:Quantum:label,量子 keycodesTab:Steno:label, keymap:label,鍵位 diff --git a/src/i18n/zh.csv b/src/i18n/zh.csv index 8851cf6540..8c6d256a62 100644 --- a/src/i18n/zh.csv +++ b/src/i18n/zh.csv @@ -44,6 +44,7 @@ keycodesTab:ANSI:label, keycodesTab:AppMediaMouse:label, keycodesTab:ISO/JIS:label, keycodesTab:KeyboardSettings:label, +keycodesTab:Lighting:label, keycodesTab:Quantum:label, keycodesTab:Steno:label, keymap:label, diff --git a/src/longFormKeycodes.js b/src/longFormKeycodes.js index 73fa0292f4..6940585035 100644 --- a/src/longFormKeycodes.js +++ b/src/longFormKeycodes.js @@ -164,17 +164,8 @@ export const longFormKeycodes = { SWIN: 'SGUI', // RGB Lighting - RGB_MODE_FORWARD: 'RGB_MOD', - RGB_MODE_REVERSE: 'RGB_RMOD', - RGB_MODE_PLAIN: 'RGB_M_P', - RGB_MODE_BREATHE: 'RGB_M_B', - RGB_MODE_RAINBOW: 'RGB_M_R', - RGB_MODE_SWIRL: 'RGB_M_SW', - RGB_MODE_SNAKE: 'RGB_M_SN', - RGB_MODE_KNIGHT: 'RGB_M_K', - RGB_MODE_XMAS: 'RGB_M_X', - RGB_MODE_GRADIENT: 'RGB_M_G', - RGB_MODE_RGBTEST: 'RGB_M_T', + RGB_MODE_FORWARD: 'UG_NEXT', + RGB_MODE_REVERSE: 'UG_PREV', // US ANSI Shifted Symbols KC_TILDE: 'KC_TILD', @@ -264,6 +255,18 @@ export const longFormKeycodes = { // Grave Escape GRAVE_ESC: 'QK_GESC', KC_GESC: 'QK_GESC', + // RGBLight + RGB_TOG: 'UG_TOGG', + RGB_MOD: 'UG_NEXT', + RGB_RMOD: 'UG_PREV', + RGB_HUI: 'UG_HUEU', + RGB_HUD: 'UG_HUED', + RGB_SAI: 'UG_SATU', + RGB_SAD: 'UG_SATD', + RGB_VAI: 'UG_VALU', + RGB_VAD: 'UG_VALD', + RGB_SPI: 'UG_SPDU', + RGB_SPD: 'UG_SPDD', // Space Cadet KC_LCPO: 'SC_LCPO', KC_RCPC: 'SC_RCPC', diff --git a/src/store/keycodes.js b/src/store/keycodes.js index 06debb098c..5544922792 100644 --- a/src/store/keycodes.js +++ b/src/store/keycodes.js @@ -7,13 +7,14 @@ import ansi from './modules/keycodes/ansi'; import iso_jis from './modules/keycodes/iso-jis'; import quantum from './modules/keycodes/quantum'; import settings from './modules/keycodes/kb-settings'; +import lighting from './modules/keycodes/lighting'; import media from './modules/keycodes/app-media-mouse'; import steno from './modules/keycodes/steno'; const keycodePickerTabLayout = { ANSI_ISO: [...ansi, ...iso_jis], ISO_ANSI: [...iso_jis, ...ansi], - special: [...quantum, ...settings, ...media] + special: [...quantum, ...settings, ...lighting, ...media] }; /** @@ -126,6 +127,7 @@ export const useKeycodesStore = defineStore('keycodes', { 'ISO/JIS': 0, Quantum: 0, KeyboardSettings: 0, + Lighting: 0, AppMediaMouse: 0 }, steno: false, @@ -165,6 +167,7 @@ export const useKeycodesStore = defineStore('keycodes', { 'ISO/JIS': countMatches(this.searchFilter, iso_jis), Quantum: countMatches(this.searchFilter, quantum), KeyboardSettings: countMatches(this.searchFilter, settings), + Lighting: countMatches(this.searchFilter, lighting), AppMediaMouse: countMatches(this.searchFilter, media) }; } @@ -203,6 +206,7 @@ export const useKeycodesStore = defineStore('keycodes', { * & Record<'ANSI', number> * & Record<'Quantum', number> * & Record<'KeyboardSettings', number> + * & Record<'Lighting', number> * & Record<'AppMediaMouse', number> * } SearchCounters * @@ -214,5 +218,5 @@ export const useKeycodesStore = defineStore('keycodes', { * @property {string} searchFilter - current query in keycode picker search filter * @property {SearchCounters} searchCounters - count of matching keycodes per tab * @property {boolean} steno - is steno tab active - * @property {'ANSI'|'ISO/JIS'|'AppMediaMouse'|'Quantum'|'Steno'|'KeyboardSettings'} active - active tab + * @property {'ANSI'|'ISO/JIS'|'AppMediaMouse'|'Quantum'|'Steno'|'KeyboardSettings'|'Lighting'} active - active tab */ diff --git a/src/store/modules/keycodes/kb-settings.js b/src/store/modules/keycodes/kb-settings.js index 23b3e6dee6..1de86a845b 100644 --- a/src/store/modules/keycodes/kb-settings.js +++ b/src/store/modules/keycodes/kb-settings.js @@ -155,77 +155,5 @@ export default [ code: 'NK_TOGG', title: 'Turn NKRO on or off', width: 1500 - }, - - { - label: 'Backlight settings', - width: 'label' - }, - - { - name: 'BL Toggle', - code: 'BL_TOGG', - title: 'Turn the backlight on or off' - }, - { - name: 'BL Cycle', - code: 'BL_STEP', - title: 'Cycle through backlight levels' - }, - { - name: 'BL Breath', - code: 'BL_BRTG', - title: 'Toggle backlight breathing' - }, - { - name: 'BL On', - code: 'BL_ON', - title: 'Set the backlight to max brightness' - }, - { - name: 'BL ⏶', - code: 'BL_UP', - title: 'Increase the backlight level' - }, - { width: 0 }, - { width: 3000 }, - { - name: 'BL Off', - code: 'BL_OFF', - title: 'Turn the backlight off' - }, - { - name: 'BL ⏷', - code: 'BL_DOWN', - title: 'Decrease the backlight level' - }, - - { label: 'RGB Lighting settings', width: 'label' }, - - { - name: 'RGB Toggle', - code: 'RGB_TOG', - title: 'Toggle RGB lighting on or off' - }, - { name: 'RGB Mode ⏵', code: 'RGB_MOD', title: 'Next RGB mode' }, - { name: 'Hue ⏶', code: 'RGB_HUI', title: 'Increase hue' }, - { name: 'Sat ⏶', code: 'RGB_SAI', title: 'Increase saturation' }, - { name: 'Bright ⏶', code: 'RGB_VAI', title: 'Increase value' }, - { name: 'Speed ⏶', code: 'RGB_SPI', title: 'Increase RGB effect speed' }, - { name: 'RGB Mode P', code: 'RGB_M_P', title: 'RGB Mode: Plain' }, - { name: 'RGB Mode B', code: 'RGB_M_B', title: 'RGB Mode: Breathe' }, - { name: 'RGB Mode R', code: 'RGB_M_R', title: 'RGB Mode: Rainbow' }, - { name: 'RGB Mode SW', code: 'RGB_M_SW', title: 'RGB Mode: Swirl' }, - { name: 'RGB Mode SN', code: 'RGB_M_SN', title: 'RGB Mode: Snake' }, - { name: 'RGB Mode K', code: 'RGB_M_K', title: 'RGB Mode: Knight Rider' }, - { name: 'RGB Mode X', code: 'RGB_M_X', title: 'RGB Mode: Christmas' }, - { name: 'RGB Mode G', code: 'RGB_M_G', title: 'RGB Mode: Gradient' }, - { name: 'RGB Mode T', code: 'RGB_M_T', title: 'RGB Mode: Test' }, - { width: 0 }, - { width: 1000 }, - { name: 'RGB Mode ⏴', code: 'RGB_RMOD', title: 'Previous RGB mode' }, - { name: 'Hue ⏷', code: 'RGB_HUD', title: 'Decrease hue' }, - { name: 'Sat ⏷', code: 'RGB_SAD', title: 'Decrease saturation' }, - { name: 'Bright ⏷', code: 'RGB_VAD', title: 'Decrease value' }, - { name: 'Speed ⏷', code: 'RGB_SPD', title: 'Decrease RGB effect speed' } + } ]; diff --git a/src/store/modules/keycodes/lighting.js b/src/store/modules/keycodes/lighting.js new file mode 100644 index 0000000000..ad865c7ead --- /dev/null +++ b/src/store/modules/keycodes/lighting.js @@ -0,0 +1,111 @@ +export default [ + { label: 'Lighting', group: true }, + + { label: 'Backlight (single color)', width: 'label' }, + + { + name: 'Toggle BL', + code: 'BL_TOGG', + title: 'Turn backlight on and off' + }, + { + name: 'BL On', + code: 'BL_ON', + title: 'Turn backlight on' + }, + { + name: 'BL Cycle', + code: 'BL_STEP', + title: 'Cycle through brightness levels' + }, + { + name: 'Bright ⏶', + code: 'BL_UP', + title: 'Increase backlight brightness' + }, + + { width: 0 }, + + { width: 1000 }, + { + name: 'BL Off', + code: 'BL_OFF', + title: 'Turn backlight off' + }, + { + name: 'BL Breath', + code: 'BL_BRTG', + title: 'Toggle backlight breathing' + }, + { + name: 'Bright ⏷', + code: 'BL_DOWN', + title: 'Decrease backlight brightness' + }, + + { label: 'LED Matrix (single color)', width: 'label' }, + + { + name: 'Toggle LM', + code: 'LM_TOGG', + title: 'Turn LED Matrix on and off' + }, + { name: 'LM On', code: 'LM_ON', title: 'Turn LED Matrix on' }, + { name: 'Mode ⏵', code: 'LM_NEXT', title: 'Next LED Matrix animation' }, + { name: 'Bright ⏶', code: 'LM_VALU', title: 'Increase brightness' }, + { name: 'Speed ⏶', code: 'LM_SPDU', title: 'Increase animation speed' }, + + { width: 0 }, + + { width: 1000 }, + { name: 'LM Off', code: 'LM_OFF', title: 'Turn LED Matrix off' }, + { name: 'Mode ⏴', code: 'LM_PREV', title: 'Previous LED Matrix animation' }, + { name: 'Bright ⏷', code: 'LM_VALD', title: 'Decrease brightness' }, + { name: 'Speed ⏷', code: 'LM_SPDD', title: 'Decrease animation speed' }, + + { label: 'RGB Underglow', width: 'label' }, + + { + name: 'Toggle UG', + code: 'UG_TOGG', + title: 'Turn RGB Underglow on and off' + }, + { name: 'Mode ⏵', code: 'UG_NEXT', title: 'Next Underglow animation' }, + { name: 'Hue ⏶', code: 'UG_HUEU', title: 'Increase hue' }, + { name: 'Sat ⏶', code: 'UG_SATU', title: 'Increase saturation' }, + { name: 'Bright ⏶', code: 'UG_VALU', title: 'Increase value (brightness)' }, + { name: 'Speed ⏶', code: 'UG_SPDU', title: 'Increase animation speed' }, + + { width: 0 }, + + { width: 1000 }, + { name: 'Mode ⏴', code: 'UG_PREV', title: 'Previous Underglow animation' }, + { name: 'Hue ⏷', code: 'UG_HUED', title: 'Decrease hue' }, + { name: 'Sat ⏷', code: 'UG_SATD', title: 'Decrease saturation' }, + { name: 'Bright ⏷', code: 'UG_VALD', title: 'Decrease value (brightness)' }, + { name: 'Speed ⏷', code: 'UG_SPDD', title: 'Decrease animation speed' }, + + { label: 'RGB Matrix', width: 'label' }, + + { + name: 'Toggle RM', + code: 'RM_TOGG', + title: 'Turn RGB Matrix on and off' + }, + { name: 'RM On', code: 'RM_ON', title: 'Turn RGB Matrix on' }, + { name: 'Mode ⏵', code: 'RM_NEXT', title: 'Next RGB Matrix animation' }, + { name: 'Hue ⏶', code: 'RM_HUEU', title: 'Increase hue' }, + { name: 'Sat ⏶', code: 'RM_SATU', title: 'Increase saturation' }, + { name: 'Bright ⏶', code: 'RM_VALU', title: 'Increase value (brightness)' }, + { name: 'Speed ⏶', code: 'RM_SPDU', title: 'Increase animation speed' }, + + { width: 0 }, + + { width: 1000 }, + { name: 'RM Off', code: 'RM_OFF', title: 'Turn RGB Matrix off' }, + { name: 'Mode ⏴', code: 'RM_PREV', title: 'Previous RGB Matrix animation' }, + { name: 'Hue ⏷', code: 'RM_HUED', title: 'Decrease hue' }, + { name: 'Sat ⏷', code: 'RM_SATD', title: 'Decrease saturation' }, + { name: 'Bright ⏷', code: 'RM_VALD', title: 'Decrease value (brightness)' }, + { name: 'Speed ⏷', code: 'RM_SPDD', title: 'Decrease animation speed' } +];