mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-05-18 07:10:40 +00:00
Modified by the teachings of "drashna" -2nd
This commit is contained in:
parent
5de432a2b7
commit
71ac6a6b51
327
keyboards/aplusx_pulsar/xboard_qs/keyboard.json
Normal file
327
keyboards/aplusx_pulsar/xboard_qs/keyboard.json
Normal file
@ -0,0 +1,327 @@
|
||||
{
|
||||
"keyboard_name": "Pulsar XBOARD QS",
|
||||
"manufacturer": "Pulsar",
|
||||
"url": "https://pulsargg.kr/",
|
||||
"maintainer": "James Yun",
|
||||
|
||||
"processor": "STM32F072",
|
||||
"bootloader": "stm32-dfu",
|
||||
|
||||
"usb": {
|
||||
"vid": "0x3710",
|
||||
"pid": "0x2400",
|
||||
"device_version": "0.0.5"
|
||||
},
|
||||
|
||||
"matrix_pins": {
|
||||
"rows": ["A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7"],
|
||||
"cols": ["C4", "C5", "B0", "B1", "B2", "B10", "B11", "B12", "B13", "B14", "A15", "C6", "C7", "C10", "C11", "C12"]
|
||||
},
|
||||
"diode_direction": "ROW2COL",
|
||||
"build": {
|
||||
"lto": true
|
||||
},
|
||||
"features": {
|
||||
"bootmagic": true,
|
||||
"extrakey": true,
|
||||
"mousekey": true,
|
||||
"nkro": true,
|
||||
"encoder": true,
|
||||
"rgb_matrix": true
|
||||
},
|
||||
"bootmagic": {
|
||||
"matrix": [2, 7]
|
||||
},
|
||||
"eeprom": {
|
||||
"wear_leveling": {
|
||||
"backing_size": 4096
|
||||
}
|
||||
},
|
||||
"encoder": {
|
||||
"rotary": [
|
||||
{"pin_a": "C13", "pin_b": "C14"}
|
||||
]
|
||||
},
|
||||
"rgb_matrix": {
|
||||
"driver": "ws2812",
|
||||
"default":{
|
||||
"val": 60
|
||||
},
|
||||
"sleep": true,
|
||||
"max_brightness": 220,
|
||||
"center_point": [80, 30],
|
||||
"sat_steps": 8,
|
||||
"speed_steps": 10,
|
||||
"val_steps": 8,
|
||||
"animations": {
|
||||
"alphas_mods": true,
|
||||
"gradient_up_down": true,
|
||||
"gradient_left_right": true,
|
||||
"breathing": true,
|
||||
"band_sat": true,
|
||||
"band_val": true,
|
||||
"band_pinwheel_sat": true,
|
||||
"band_pinwheel_val": true,
|
||||
"band_spiral_sat": true,
|
||||
"band_spiral_val": true,
|
||||
"cycle_all": true,
|
||||
"cycle_left_right": true,
|
||||
"cycle_up_down": true,
|
||||
"cycle_out_in": true,
|
||||
"cycle_out_in_dual": true,
|
||||
"rainbow_moving_chevron": true,
|
||||
"cycle_pinwheel": true,
|
||||
"cycle_spiral": true,
|
||||
"dual_beacon": true,
|
||||
"rainbow_beacon": true,
|
||||
"rainbow_pinwheels": true,
|
||||
"raindrops": true,
|
||||
"jellybean_raindrops": true,
|
||||
"hue_breathing": true,
|
||||
"hue_pendulum": true,
|
||||
"hue_wave": true,
|
||||
"pixel_fractal": true,
|
||||
"pixel_flow": true,
|
||||
"pixel_rain": true,
|
||||
"typing_heatmap": true,
|
||||
"digital_rain": true,
|
||||
"solid_reactive_simple": true,
|
||||
"solid_reactive": true,
|
||||
"solid_reactive_wide": true,
|
||||
"solid_reactive_multiwide": true,
|
||||
"solid_reactive_cross": true,
|
||||
"solid_reactive_multicross": true,
|
||||
"solid_reactive_nexus": true,
|
||||
"solid_reactive_multinexus": true,
|
||||
"splash": true,
|
||||
"multisplash": true,
|
||||
"solid_splash": true,
|
||||
"solid_multisplash": true
|
||||
},
|
||||
|
||||
"layout": [
|
||||
{"x": 0, "y": 0, "flags": 1},
|
||||
{"x": 9, "y": 0, "flags": 1},
|
||||
{"x": 18, "y": 0, "flags": 1},
|
||||
{"x": 27, "y": 0, "flags": 1},
|
||||
{"x": 36, "y": 0, "flags": 1},
|
||||
{"x": 45, "y": 0, "flags": 1},
|
||||
{"x": 54, "y": 0, "flags": 1},
|
||||
{"x": 63, "y": 0, "flags": 1},
|
||||
{"x": 72, "y": 0, "flags": 1},
|
||||
{"x": 81, "y": 0, "flags": 1},
|
||||
{"x": 90, "y": 0, "flags": 1},
|
||||
{"x": 99, "y": 0, "flags": 1},
|
||||
{"x": 108, "y": 0, "flags": 1},
|
||||
{"x": 117, "y": 0, "flags": 1},
|
||||
{"x": 126, "y": 0, "flags": 1},
|
||||
{"x": 135, "y": 0, "flags": 1},
|
||||
{"matrix": [6, 1], "x": 144, "y": 0, "flags": 1},
|
||||
{"matrix": [6, 2], "x": 153, "y": 0, "flags": 1},
|
||||
{"x": 162, "y": 0, "flags": 1},
|
||||
{"matrix": [6, 3], "x": 171, "y": 0, "flags": 1},
|
||||
{"x": 180, "y": 0, "flags": 1},
|
||||
{"matrix": [0, 15], "x": 180, "y": 11, "flags": 1},
|
||||
{"matrix": [0, 14], "x": 169, "y": 11, "flags": 1},
|
||||
{"matrix": [0, 13], "x": 159, "y": 11, "flags": 1},
|
||||
{"matrix": [6, 0], "x": 144, "y": 11, "flags": 1},
|
||||
{"matrix": [0, 12], "x": 133, "y": 11, "flags": 4},
|
||||
{"matrix": [0, 11], "x": 123, "y": 11, "flags": 4},
|
||||
{"matrix": [0, 10], "x": 112, "y": 11, "flags": 4},
|
||||
{"matrix": [0, 9], "x": 102, "y": 11, "flags": 4},
|
||||
{"matrix": [0, 8], "x": 89, "y": 11, "flags": 1},
|
||||
{"matrix": [0, 7], "x": 78, "y": 11, "flags": 1},
|
||||
{"matrix": [0, 6], "x": 68, "y": 11, "flags": 1},
|
||||
{"matrix": [0, 5], "x": 57, "y": 11, "flags": 1},
|
||||
{"matrix": [0, 4], "x": 45, "y": 11, "flags": 4},
|
||||
{"matrix": [0, 3], "x": 34, "y": 11, "flags": 4},
|
||||
{"matrix": [0, 2], "x": 24, "y": 11, "flags": 4},
|
||||
{"matrix": [0, 1], "x": 13, "y": 11, "flags": 4},
|
||||
{"matrix": [0, 0], "x": 0, "y": 11, "flags": 1},
|
||||
{"matrix": [1, 0], "x": 0, "y": 21, "flags": 4},
|
||||
{"matrix": [1, 1], "x": 10, "y": 21, "flags": 4},
|
||||
{"matrix": [1, 2], "x": 21, "y": 21, "flags": 4},
|
||||
{"matrix": [1, 3], "x": 31, "y": 21, "flags": 4},
|
||||
{"matrix": [1, 4], "x": 42, "y": 21, "flags": 4},
|
||||
{"matrix": [1, 5], "x": 52, "y": 21, "flags": 4},
|
||||
{"matrix": [1, 6], "x": 63, "y": 21, "flags": 4},
|
||||
{"matrix": [1, 7], "x": 73, "y": 21, "flags": 4},
|
||||
{"matrix": [1, 8], "x": 83, "y": 21, "flags": 4},
|
||||
{"matrix": [1, 9], "x": 94, "y": 21, "flags": 4},
|
||||
{"matrix": [1, 10], "x": 104, "y": 21, "flags": 4},
|
||||
{"matrix": [1, 11], "x": 115, "y": 21, "flags": 4},
|
||||
{"matrix": [1, 12], "x": 125, "y": 21, "flags": 4},
|
||||
{"matrix": [1, 14], "x": 139, "y": 21, "flags": 1},
|
||||
{"matrix": [2, 14], "x": 159, "y": 21, "flags": 1},
|
||||
{"matrix": [2, 15], "x": 169, "y": 21, "flags": 1},
|
||||
{"matrix": [1, 15], "x": 180, "y": 21, "flags": 1},
|
||||
{"matrix": [3, 15], "x": 180, "y": 32, "flags": 1},
|
||||
{"matrix": [3, 14], "x": 169, "y": 32, "flags": 1},
|
||||
{"matrix": [3, 13], "x": 159, "y": 32, "flags": 1},
|
||||
{"matrix": [2, 13], "x": 143, "y": 32, "flags": 4},
|
||||
{"matrix": [2, 12], "x": 130, "y": 32, "flags": 4},
|
||||
{"matrix": [2, 11], "x": 120, "y": 32, "flags": 4},
|
||||
{"matrix": [2, 10], "x": 109, "y": 32, "flags": 4},
|
||||
{"matrix": [2, 9], "x": 99, "y": 32, "flags": 4},
|
||||
{"matrix": [2, 8], "x": 89, "y": 32, "flags": 4},
|
||||
{"matrix": [2, 7], "x": 78, "y": 32, "flags": 4},
|
||||
{"matrix": [2, 6], "x": 68, "y": 32, "flags": 4},
|
||||
{"matrix": [2, 5], "x": 57, "y": 32, "flags": 4},
|
||||
{"matrix": [2, 4], "x": 47, "y": 32, "flags": 4},
|
||||
{"matrix": [2, 3], "x": 36, "y": 32, "flags": 4},
|
||||
{"matrix": [2, 2], "x": 26, "y": 32, "flags": 4},
|
||||
{"matrix": [2, 1], "x": 16, "y": 32, "flags": 4},
|
||||
{"matrix": [2, 0], "x": 3, "y": 32, "flags": 1},
|
||||
{"matrix": [3, 0], "x": 4, "y": 43, "flags": 1},
|
||||
{"matrix": [3, 1], "x": 18, "y": 43, "flags": 4},
|
||||
{"matrix": [3, 2], "x": 29, "y": 43, "flags": 4},
|
||||
{"matrix": [3, 3], "x": 39, "y": 43, "flags": 4},
|
||||
{"matrix": [3, 4], "x": 50, "y": 43, "flags": 4},
|
||||
{"matrix": [3, 5], "x": 60, "y": 43, "flags": 4},
|
||||
{"matrix": [3, 6], "x": 70, "y": 43, "flags": 4},
|
||||
{"matrix": [3, 7], "x": 81, "y": 43, "flags": 4},
|
||||
{"matrix": [3, 8], "x": 91, "y": 43, "flags": 4},
|
||||
{"matrix": [3, 9], "x": 102, "y": 43, "flags": 4},
|
||||
{"matrix": [3, 10], "x": 112, "y": 43, "flags": 4},
|
||||
{"matrix": [3, 11], "x": 123, "y": 43, "flags": 4},
|
||||
{"matrix": [4, 14], "x": 138, "y": 43, "flags": 1},
|
||||
{"matrix": [4, 15], "x": 169, "y": 53, "flags": 1},
|
||||
{"matrix": [4, 13], "x": 135, "y": 53, "flags": 1},
|
||||
{"matrix": [4, 11], "x": 117, "y": 53, "flags": 4},
|
||||
{"matrix": [4, 10], "x": 107, "y": 53, "flags": 4},
|
||||
{"matrix": [4, 9], "x": 96, "y": 53, "flags": 4},
|
||||
{"matrix": [4, 8], "x": 86, "y": 53, "flags": 4},
|
||||
{"matrix": [4, 7], "x": 76, "y": 53, "flags": 4},
|
||||
{"matrix": [4, 6], "x": 65, "y": 53, "flags": 4},
|
||||
{"matrix": [4, 5], "x": 55, "y": 53, "flags": 4},
|
||||
{"matrix": [4, 4], "x": 44, "y": 53, "flags": 4},
|
||||
{"matrix": [4, 3], "x": 34, "y": 53, "flags": 4},
|
||||
{"matrix": [4, 2], "x": 23, "y": 53, "flags": 4},
|
||||
{"matrix": [4, 0], "x": 10, "y": 53, "flags": 1},
|
||||
{"matrix": [5, 0], "x": 1, "y": 64, "flags": 1},
|
||||
{"matrix": [5, 1], "x": 14, "y": 64, "flags": 1},
|
||||
{"matrix": [5, 2], "x": 27, "y": 64, "flags": 1},
|
||||
{"x": 50, "y": 64, "flags": 4},
|
||||
{"matrix": [5, 6], "x": 66, "y": 64, "flags": 4},
|
||||
{"x": 80, "y": 64, "flags": 4},
|
||||
{"matrix": [5, 10], "x": 105, "y": 64, "flags": 1},
|
||||
{"matrix": [5, 11], "x": 118, "y": 64, "flags": 1},
|
||||
{"matrix": [5, 12], "x": 131, "y": 64, "flags": 1},
|
||||
{"matrix": [5, 13], "x": 145, "y": 64, "flags": 1},
|
||||
{"matrix": [5, 14], "x": 159, "y": 64, "flags": 1},
|
||||
{"matrix": [5, 15], "x": 169, "y": 64, "flags": 1},
|
||||
{"matrix": [6, 15], "x": 180, "y": 64, "flags": 1}
|
||||
]
|
||||
},
|
||||
|
||||
"ws2812": {
|
||||
"pin": "B15",
|
||||
"driver": "spi"
|
||||
},
|
||||
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"layout": [
|
||||
{ "matrix":[6,1],"label": "PC1", "x": 14.05, "y": 0 },
|
||||
{ "matrix":[6,2],"label": "PC2", "x": 15.3, "y": 0 },
|
||||
{ "matrix":[6,3],"label": "Audio", "x": 17, "y": 0 },
|
||||
|
||||
{ "matrix":[0,0], "label": "Esc", "x": 0, "y": 1.3 },
|
||||
{ "matrix":[0,1], "label": "F1", "x": 1.3, "y": 1.3 },
|
||||
{ "matrix":[0,2], "label": "F2", "x": 2.3, "y": 1.3 },
|
||||
{ "matrix":[0,3], "label": "F3", "x": 3.3, "y": 1.3 },
|
||||
{ "matrix":[0,4], "label": "F4", "x": 4.3, "y": 1.3 },
|
||||
{ "matrix":[0,5], "label": "F5", "x": 5.55, "y": 1.3 },
|
||||
{ "matrix":[0,6], "label": "F6", "x": 6.55, "y": 1.3 },
|
||||
{ "matrix":[0,7], "label": "F7", "x": 7.55, "y": 1.3 },
|
||||
{ "matrix":[0,8], "label": "F8", "x": 8.55, "y": 1.3 },
|
||||
{ "matrix":[0,9], "label": "F9", "x": 9.8, "y": 1.3 },
|
||||
{ "matrix":[0,10], "label": "F10", "x": 10.8, "y": 1.3 },
|
||||
{ "matrix":[0,11], "label": "F11", "x": 11.8, "y": 1.3 },
|
||||
{ "matrix":[0,12], "label": "F12", "x": 12.8, "y": 1.3 },
|
||||
|
||||
{ "matrix":[6,0], "label": "QUICK", "x": 14.05, "y": 1.3 },
|
||||
|
||||
{ "matrix":[0,13], "label": "PrtSc", "x": 15.3, "y": 1.3 },
|
||||
{ "matrix":[0,14], "label": "Scroll Lock", "x": 16.3, "y": 1.3 },
|
||||
{ "matrix":[0,15], "label": "Pause", "x": 17.3, "y": 1.3 },
|
||||
|
||||
{ "matrix":[1,0], "label": "~", "x": 0, "y": 2.5 },
|
||||
{ "matrix":[1,1], "label": "!", "x": 1, "y": 2.5 },
|
||||
{ "matrix":[1,2], "label": "@", "x": 2, "y": 2.5 },
|
||||
{ "matrix":[1,3], "label": "#", "x": 3, "y": 2.5 },
|
||||
{ "matrix":[1,4], "label": "$", "x": 4, "y": 2.5 },
|
||||
{ "matrix":[1,5], "label": "%", "x": 5, "y": 2.5 },
|
||||
{ "matrix":[1,6], "label": "^", "x": 6, "y": 2.5 },
|
||||
{ "matrix":[1,7], "label": "&", "x": 7, "y": 2.5 },
|
||||
{ "matrix":[1,8], "label": "*", "x": 8, "y": 2.5 },
|
||||
{ "matrix":[1,9], "label": "(", "x": 9, "y": 2.5 },
|
||||
{ "matrix":[1,10], "label": ")", "x": 10, "y": 2.5 },
|
||||
{ "matrix":[1,11], "label": "_", "x": 11, "y": 2.5 },
|
||||
{ "matrix":[1,12], "label": "+", "x": 12, "y": 2.5 },
|
||||
{ "matrix":[1,14], "label": "Backspace", "x": 13, "y": 2.5, "w": 2 },
|
||||
{ "matrix":[2,14], "label": "Insert", "x": 15.25, "y": 2.5 },
|
||||
{ "matrix":[2,15], "label": "Home", "x": 16.25, "y": 2.5 },
|
||||
{ "matrix":[1,15], "label": "PgUp", "x": 17.25, "y": 2.5 },
|
||||
|
||||
{ "matrix":[2,0], "label": "Tab", "x": 0, "y": 3.5, "w": 1.5 },
|
||||
{ "matrix":[2,1], "label": "Q", "x": 1.5, "y": 3.5 },
|
||||
{ "matrix":[2,2], "label": "W", "x": 2.5, "y": 3.5 },
|
||||
{ "matrix":[2,3], "label": "E", "x": 3.5, "y": 3.5 },
|
||||
{ "matrix":[2,4], "label": "R", "x": 4.5, "y": 3.5 },
|
||||
{ "matrix":[2,5], "label": "T", "x": 5.5, "y": 3.5 },
|
||||
{ "matrix":[2,6], "label": "Y", "x": 6.5, "y": 3.5 },
|
||||
{ "matrix":[2,7], "label": "U", "x": 7.5, "y": 3.5 },
|
||||
{ "matrix":[2,8], "label": "I", "x": 8.5, "y": 3.5 },
|
||||
{ "matrix":[2,9], "label": "O", "x": 9.5, "y": 3.5 },
|
||||
{ "matrix":[2,10], "label": "P", "x": 10.5, "y": 3.5 },
|
||||
{ "matrix":[2,11], "label": "{", "x": 11.5, "y": 3.5 },
|
||||
{ "matrix":[2,12], "label": "}", "x": 12.5, "y": 3.5 },
|
||||
{ "matrix":[2,13], "label": "|", "x": 13.5, "y": 3.5, "w": 1.5 },
|
||||
{ "matrix":[3,13], "label": "Delete", "x": 15.25, "y": 3.5 },
|
||||
{ "matrix":[3,14], "label": "End", "x": 16.25, "y": 3.5 },
|
||||
{ "matrix":[3,15], "label": "PgDn", "x": 17.25, "y": 3.5 },
|
||||
|
||||
{ "matrix":[3,0], "label": "Caps Lock", "x": 0, "y": 4.5, "w": 1.75 },
|
||||
{ "matrix":[3,1], "label": "A", "x": 1.75, "y": 4.5 },
|
||||
{ "matrix":[3,2], "label": "S", "x": 2.75, "y": 4.5 },
|
||||
{ "matrix":[3,3], "label": "D", "x": 3.75, "y": 4.5 },
|
||||
{ "matrix":[3,4], "label": "F", "x": 4.75, "y": 4.5 },
|
||||
{ "matrix":[3,5], "label": "G", "x": 5.75, "y": 4.5 },
|
||||
{ "matrix":[3,6], "label": "H", "x": 6.75, "y": 4.5 },
|
||||
{ "matrix":[3,7], "label": "J", "x": 7.75, "y": 4.5 },
|
||||
{ "matrix":[3,8], "label": "K", "x": 8.75, "y": 4.5 },
|
||||
{ "matrix":[3,9], "label": "L", "x": 9.75, "y": 4.5 },
|
||||
{ "matrix":[3,10], "label": ":", "x": 10.75, "y": 4.5 },
|
||||
{ "matrix":[3,11], "label": "\"", "x": 11.75, "y": 4.5 },
|
||||
{ "matrix":[4,14], "label": "Enter", "x": 12.75, "y": 4.5, "w": 2.25 },
|
||||
|
||||
{ "matrix":[4,0], "label": "Shift", "x": 0, "y": 5.5, "w": 2.25 },
|
||||
{ "matrix":[4,2], "label": "Z", "x": 2.25, "y": 5.5 },
|
||||
{ "matrix":[4,3], "label": "X", "x": 3.25, "y": 5.5 },
|
||||
{ "matrix":[4,4], "label": "C", "x": 4.25, "y": 5.5 },
|
||||
{ "matrix":[4,5], "label": "V", "x": 5.25, "y": 5.5 },
|
||||
{ "matrix":[4,6], "label": "B", "x": 6.25, "y": 5.5 },
|
||||
{ "matrix":[4,7], "label": "N", "x": 7.25, "y": 5.5 },
|
||||
{ "matrix":[4,8], "label": "M", "x": 8.25, "y": 5.5 },
|
||||
{ "matrix":[4,9], "label": "<", "x": 9.25, "y": 5.5 },
|
||||
{ "matrix":[4,10], "label": ">", "x": 10.25, "y": 5.5 },
|
||||
{ "matrix":[4,11], "label": "?", "x": 11.25, "y": 5.5 },
|
||||
{ "matrix":[4,13], "label": "Shift", "x": 12.25, "y": 5.5, "w": 2.75 },
|
||||
{ "matrix":[4,15], "label": "Up", "x": 16.25, "y": 5.5 },
|
||||
|
||||
{ "matrix":[5,0], "label": "Ctrl", "x": 0, "y": 6.5, "w": 1.25 },
|
||||
{ "matrix":[5,1], "label": "Win", "x": 1.25, "y": 6.5, "w": 1.25 },
|
||||
{ "matrix":[5,2], "label": "Alt", "x": 2.5, "y": 6.5, "w": 1.25 },
|
||||
{ "matrix":[5,6], "label": "Space","x": 3.75, "y": 6.5, "w": 6.25 },
|
||||
{ "matrix":[5,10], "label": "Alt", "x": 10, "y": 6.5, "w": 1.25 },
|
||||
{ "matrix":[5,11], "label": "Fn", "x": 11.25, "y": 6.5, "w": 1.25 },
|
||||
{ "matrix":[5,12], "label": "Menu", "x": 12.5, "y": 6.5, "w": 1.25 },
|
||||
{ "matrix":[5,13], "label": "Ctrl", "x": 13.75, "y": 6.5, "w": 1.25 },
|
||||
{ "matrix":[5,14], "label": "Left", "x": 15.25, "y": 6.5 },
|
||||
{ "matrix":[5,15], "label": "Down", "x": 16.25, "y": 6.5 },
|
||||
{ "matrix":[6,15], "label": "Right", "x": 17.25, "y": 6.5 }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
239
keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c
Normal file
239
keyboards/aplusx_pulsar/xboard_qs/xboard_qs.c
Normal file
@ -0,0 +1,239 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
#include "xboard_qs.h"
|
||||
|
||||
static bool INIT3S_on = false;
|
||||
static bool INIT3S_led_on = false;
|
||||
static uint16_t INIT3S_timer; // for custom key, INIT_3S
|
||||
|
||||
static bool kvm_pc_sel = false;
|
||||
static uint16_t kvm_timer;
|
||||
static bool kvm_sel_on = false;
|
||||
|
||||
static bool isMacMode = false;
|
||||
static uint8_t Status_LED_Bright;
|
||||
#define kvm_deadtime 100
|
||||
|
||||
typedef union {
|
||||
uint32_t raw;
|
||||
struct {
|
||||
bool eeprom_kvm_pc_sel :1;
|
||||
uint8_t eeprom_Status_LED_Bright; //
|
||||
};
|
||||
} user_config_t;
|
||||
|
||||
user_config_t user_config;
|
||||
|
||||
void kvm_switch(bool pc_num){
|
||||
writePinHigh(GPIO_KM_OE);
|
||||
writePinLow(GPIO_KM_PWEN);
|
||||
if (!pc_num) writePinLow(GPIO_KM_SEL);
|
||||
else writePinHigh(GPIO_KM_SEL);
|
||||
writePinLow(GPIO_KM_OE);
|
||||
|
||||
kvm_timer = timer_read();
|
||||
kvm_sel_on = true;
|
||||
};
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
setPinOutput(GPIO_KM_OE); // H/W power on default = 0
|
||||
setPinOutput(GPIO_KM_SEL); // H/W power on default = 0
|
||||
setPinOutput(GPIO_KM_PWEN); // H/W power on default = 1
|
||||
}
|
||||
|
||||
void keyboard_post_init_kb(void) {
|
||||
user_config.raw = eeconfig_read_user(); // Read the user config from EEPROM
|
||||
kvm_pc_sel = user_config.eeprom_kvm_pc_sel;
|
||||
kvm_switch(kvm_pc_sel);
|
||||
|
||||
Status_LED_Bright = user_config.eeprom_Status_LED_Bright; // 0 = 초기값, 1~5 = 50~250의 5단계 밝기
|
||||
if (Status_LED_Bright == 0) Status_LED_Bright = 5;
|
||||
}
|
||||
|
||||
#define HCS(report) host_consumer_send(record->event.pressed ? report : 0); return false
|
||||
#define HSS(report) host_system_send(record->event.pressed ? report : 0); return false
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
switch (keycode) {
|
||||
case INIT_3S:
|
||||
if (record->event.pressed){
|
||||
INIT3S_timer = timer_read();
|
||||
INIT3S_on = true;
|
||||
}
|
||||
else{
|
||||
INIT3S_on = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case KC_SPOTLIGHT:
|
||||
HCS(0x221);
|
||||
case KC_DICTATION:
|
||||
HCS(0xCF);
|
||||
case KC_DO_NOT_DISTURB:
|
||||
HSS(0x9B);
|
||||
case KC_LOCK_SCREEN:
|
||||
HCS(0x19E);
|
||||
|
||||
case KC_WIN_MODE:
|
||||
set_single_persistent_default_layer(0);
|
||||
isMacMode = false;
|
||||
return false;
|
||||
|
||||
case KC_MAC_MODE:
|
||||
set_single_persistent_default_layer(2);
|
||||
isMacMode = true;
|
||||
return false;
|
||||
|
||||
case KC_TMODE:
|
||||
if (record->event.pressed) {
|
||||
if (get_highest_layer(layer_state|default_layer_state) >= 2) {
|
||||
set_single_persistent_default_layer(2);
|
||||
isMacMode = true;
|
||||
} else {
|
||||
set_single_persistent_default_layer(0);
|
||||
isMacMode = false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
case KC_PC1:
|
||||
if (record->event.pressed) {
|
||||
if (kvm_pc_sel) {
|
||||
kvm_pc_sel = 0;
|
||||
kvm_switch(0);
|
||||
|
||||
user_config.eeprom_kvm_pc_sel = kvm_pc_sel;
|
||||
eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
case KC_PC2:
|
||||
if (record->event.pressed) {
|
||||
if (!kvm_pc_sel){
|
||||
kvm_pc_sel = 1;
|
||||
kvm_switch(1);
|
||||
|
||||
user_config.eeprom_kvm_pc_sel = kvm_pc_sel;
|
||||
eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
case KC_TPC:
|
||||
if (record->event.pressed) {
|
||||
kvm_pc_sel = !kvm_pc_sel;
|
||||
if (kvm_pc_sel) kvm_switch(1);
|
||||
else kvm_switch(0);
|
||||
user_config.eeprom_kvm_pc_sel = kvm_pc_sel; //
|
||||
eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM
|
||||
}
|
||||
return false;
|
||||
|
||||
case KC_S_LED: // Change Status LED Brightness
|
||||
if (record->event.pressed) {
|
||||
if (++Status_LED_Bright > 5) {
|
||||
Status_LED_Bright = 1;
|
||||
};
|
||||
user_config.eeprom_Status_LED_Bright = Status_LED_Bright; //
|
||||
eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM
|
||||
}
|
||||
return false;
|
||||
|
||||
default:
|
||||
return true; // Process all other keycodes normally
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isRecording = false; // dynamic macro REC. LED
|
||||
bool isRecordingLedOn = false;
|
||||
static uint16_t recording_timer;
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
|
||||
if (kvm_sel_on == true){
|
||||
if (timer_elapsed(kvm_timer) > kvm_deadtime ) {
|
||||
writePinHigh(GPIO_KM_PWEN);
|
||||
kvm_sel_on = false; //// 키보드 리셋이 필요?
|
||||
}
|
||||
}
|
||||
|
||||
if (INIT3S_on == true){
|
||||
if (timer_elapsed(INIT3S_timer) > 3000){
|
||||
INIT3S_on = false;
|
||||
INIT3S_led_on = true;
|
||||
INIT3S_timer = timer_read();
|
||||
}
|
||||
}
|
||||
if (INIT3S_led_on == true){
|
||||
if(timer_elapsed(INIT3S_timer) > 2000){
|
||||
eeconfig_init();
|
||||
soft_reset_keyboard();
|
||||
}
|
||||
}
|
||||
|
||||
if (isRecording){
|
||||
if(timer_elapsed(recording_timer) > 500)
|
||||
{
|
||||
isRecordingLedOn = !isRecordingLedOn;
|
||||
recording_timer = timer_read();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DYNAMIC_MACRO_ENABLE
|
||||
void dynamic_macro_record_start_kb(int8_t direction) {
|
||||
isRecording = true;
|
||||
isRecordingLedOn = true;
|
||||
recording_timer = timer_read();
|
||||
}
|
||||
void dynamic_macro_record_end_kb(int8_t direction){
|
||||
isRecording = false;
|
||||
isRecordingLedOn = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool rgb_matrix_indicators_kb(void) {
|
||||
|
||||
uint8_t Status_LED_Bright_value = Status_LED_Bright * 50;
|
||||
|
||||
led_t host_leds = host_keyboard_led_state();
|
||||
|
||||
if (host_leds.caps_lock) {
|
||||
rgb_matrix_set_color(72, Status_LED_Bright_value, Status_LED_Bright_value, Status_LED_Bright_value);
|
||||
}
|
||||
if (host_leds.scroll_lock) {
|
||||
rgb_matrix_set_color(22, Status_LED_Bright_value, Status_LED_Bright_value, Status_LED_Bright_value);
|
||||
}
|
||||
|
||||
if (INIT3S_led_on == true){ // Factory Reset ; all LED is RED
|
||||
rgb_matrix_set_color_all(0xff, 0, 0);
|
||||
}
|
||||
|
||||
if (keymap_config.no_gui){ // WIN key Lock
|
||||
rgb_matrix_set_color(99, Status_LED_Bright_value, Status_LED_Bright_value, Status_LED_Bright_value);
|
||||
}
|
||||
|
||||
if (isRecordingLedOn) { // Dynamic Macro Recording LED Blink
|
||||
rgb_matrix_set_color(38, Status_LED_Bright_value, Status_LED_Bright_value, Status_LED_Bright_value);
|
||||
}
|
||||
|
||||
if (get_highest_layer(layer_state|default_layer_state) >= 2) {
|
||||
rgb_matrix_set_color(24,Status_LED_Bright_value,0,0); // WIN-MAC key
|
||||
isMacMode = true;
|
||||
|
||||
if (kvm_pc_sel) rgb_matrix_set_color(103,Status_LED_Bright_value,0,0); // MAC Mode & PC2
|
||||
else rgb_matrix_set_color(101,Status_LED_Bright_value,0,0); // MAC Mode & PC1
|
||||
|
||||
} else {
|
||||
rgb_matrix_set_color(24,0,0,Status_LED_Bright_value); // WIN-MAC key
|
||||
isMacMode = false;
|
||||
|
||||
if (kvm_pc_sel) rgb_matrix_set_color(103,0,0,Status_LED_Bright_value); // Windows Mode & PC2
|
||||
else rgb_matrix_set_color(101,0,0,Status_LED_Bright_value); // Windows Mode & PC1
|
||||
}
|
||||
|
||||
return false; // return TRUE;
|
||||
}
|
35
keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h
Normal file
35
keyboards/aplusx_pulsar/xboard_qs/xboard_qs.h
Normal file
@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
enum pulsar_keycodes {
|
||||
KC_TGUI = QK_KB_0, // Ver 0.21.6에서 변경 (USER00,) // Toggle between GUI Lock or Unlock
|
||||
KC_WIN_MODE, // WINDOWS Keyboard로 변경
|
||||
KC_MAC_MODE, // Machintosh Keyboard로 변경
|
||||
KC_TMODE, // WINDOWS <--> Machintosh
|
||||
KC_SPOTLIGHT, // MAC_key
|
||||
KC_DICTATION, // MAC_key
|
||||
KC_DO_NOT_DISTURB, // MAC_key
|
||||
KC_LOCK_SCREEN, // MAC_key
|
||||
KC_TASK_VIEW, // for win (gui + tap)
|
||||
KC_FILE_EXPLORER, // for win (gui + e)
|
||||
KC_PC1, // KM Switch PC1
|
||||
KC_PC2, // KM Switch PC2
|
||||
KC_TPC, // KM Switch PC1<-->PC2 Toggle
|
||||
INIT_3S, // EE_CLR(EEPROM CLear)(공장초기화)를 3초이상 눌러야 동작
|
||||
KC_S_LED, // Change Status LED Brightness
|
||||
};
|
||||
|
||||
#define KC_WINM KC_WIN_MODE
|
||||
#define KC_MACM KC_MAC_MODE
|
||||
|
||||
#define KC_SPLT KC_SPOTLIGHT
|
||||
#define KC_SIRI KC_DICTATION
|
||||
#define KC_DOND KC_DO_NOT_DISTURB
|
||||
#define KC_LOCK_ KC_LOCK_SCREEN
|
||||
|
||||
#define KC_TASK LGUI(KC_TAB)
|
||||
#define KC_FLXP LGUI(KC_E)
|
||||
#define KC_DIC LGUI(KC_H) // WIN ; 받아쓰기
|
||||
#define KC_LOCK2 LGUI(KC_L) // WIN ; pc잠금
|
||||
#define KC_SNAP SCMD(KC_5) // MAC Capure ; commnd + shift + 5
|
Loading…
Reference in New Issue
Block a user