diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 6c5677f4..184aae9a 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,13 +1,9 @@ FROM zmkfirmware/zephyr-west-action-arm -ENV LC_ALL=C - RUN apt-get -y update && \ apt-get -y upgrade && \ apt-get install --no-install-recommends -y \ ssh \ - nano \ - locales \ gpg && \ rm -rf /var/lib/apt/lists/* diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0de8bcfb..14feeff4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,9 +6,6 @@ "containerEnv": {"WORKSPACE_DIR": "${containerWorkspaceFolder}"}, "settings": { "terminal.integrated.shell.linux": "/bin/bash" - }, - "mounts": [ - "type=volume,source=zmk-config,target=/workspaces/zmk-config" - ] + }, } diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e0f3e57..f4097852 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,18 +1,17 @@ -name: Build - on: push: paths: - - ".github/workflows/build.yml" - "app/**" pull_request: paths: - - ".github/workflows/build.yml" - "app/**" +name: Build + jobs: build: runs-on: ubuntu-latest + name: Build Test strategy: matrix: board: [proton_c, nice_nano, bluemicro840_v1, nrfmicro_13] @@ -26,10 +25,6 @@ jobs: - lily58_right - iris_left - iris_right - - jorne_left - - jorne_right - - jian_left - - jian_right - reviung41 - romac - romac_plus @@ -47,6 +42,8 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Cache west modules + timeout-minutes: 2 + continue-on-error: true uses: actions/cache@v2 env: cache-name: cache-zephyr-modules @@ -56,39 +53,37 @@ jobs: tools/ zephyr/ bootloader/ - key: 3-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('app/west.yml') }} + key: 2-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('app/west.yml') }} restore-keys: | - 3-${{ runner.os }}-build-${{ env.cache-name }}- - 3-${{ runner.os }}-build- - 3-${{ runner.os }}- - timeout-minutes: 2 - continue-on-error: true - - name: West init + 2-${{ runner.os }}-build-${{ env.cache-name }}- + 2-${{ runner.os }}-build- + 2-${{ runner.os }}- + - name: West Init uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" id: west-init with: args: 'init "-l app"' - - name: West update + - name: West Update uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" id: west-update with: args: "update" - - name: West config Zephyr base + - name: West Config Zephyr Base uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" id: west-config with: args: 'config "--global zephyr.base-prefer configfile"' - - name: West Zephyr export + - name: West Zephyr Export uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" id: west-zephyr-export with: args: "zephyr-export" - - name: West build + - name: West Build uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" id: west-build with: args: 'build "-s app -b ${{ matrix.board }} -- -DSHIELD=${{ matrix.shield }}"' - - name: Archive build + - name: Archive Build uses: actions/upload-artifact@v2 if: ${{ matrix.board != 'proton_c' }} with: diff --git a/.github/workflows/clang-format-lint.yml b/.github/workflows/clang-format-lint.yml index 8bd42753..70ae9863 100644 --- a/.github/workflows/clang-format-lint.yml +++ b/.github/workflows/clang-format-lint.yml @@ -1,9 +1,8 @@ -name: Clang Format +name: clang-format-lint on: push: paths: - - ".github/workflows/clang-format-lint.yml" - "app/boards/**/*.c" - "app/include/**/*.h" - "app/src/**" @@ -11,7 +10,6 @@ on: - "app/drivers/**/*.h" pull_request: paths: - - ".github/workflows/clang-format-lint.yml" - "app/boards/**/*.c" - "app/include/**/*.h" - "app/src/**" @@ -21,6 +19,8 @@ on: jobs: build: runs-on: ubuntu-latest + name: clang-format lint + steps: - uses: actions/checkout@v2 - uses: DoozyX/clang-format-lint-action@v0.9 diff --git a/.github/workflows/doc-checks.yml b/.github/workflows/doc-checks.yml index 11f74c07..a31a88e6 100644 --- a/.github/workflows/doc-checks.yml +++ b/.github/workflows/doc-checks.yml @@ -1,18 +1,18 @@ -name: Docs Checks +name: doc-checks on: push: paths: - - ".github/workflows/doc-checks.yml" - "docs/**" pull_request: paths: - - ".github/workflows/doc-checks.yml" - "docs/**" jobs: lint: runs-on: ubuntu-latest + name: ESLint + steps: - uses: actions/checkout@v2 - uses: bahmutov/npm-install@v1 @@ -24,11 +24,12 @@ jobs: prettier: runs-on: ubuntu-latest name: Prettier + steps: - uses: actions/checkout@v2 - uses: bahmutov/npm-install@v1 with: working-directory: docs - - name: Prettier check + - name: Prettier Check run: npm run prettier:check working-directory: docs diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c283e49e..a6af058c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,26 +1,27 @@ -name: Tests - on: push: paths: - - ".github/workflows/test.yml" - "app/tests/**" - "app/src/**" pull_request: paths: - - ".github/workflows/test.yml" - "app/tests/**" - "app/src/**" +name: Test + jobs: integration_test: runs-on: ubuntu-latest + name: Integration Tests steps: # To use this repository's private action, # you must check out the repository - name: Checkout uses: actions/checkout@v2 - name: Cache west modules + timeout-minutes: 2 + continue-on-error: true uses: actions/cache@v2 env: cache-name: cache-zephyr-modules @@ -30,40 +31,38 @@ jobs: tools/ zephyr/ bootloader/ - key: 3-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('app/west.yml') }} + key: 2-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('app/west.yml') }} restore-keys: | - 3-${{ runner.os }}-build-${{ env.cache-name }}- - 3-${{ runner.os }}-build- - 3-${{ runner.os }}- - timeout-minutes: 2 - continue-on-error: true - - name: West init + 2-${{ runner.os }}-build-${{ env.cache-name }}- + 2-${{ runner.os }}-build- + 2-${{ runner.os }}- + - name: West Init uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" id: west-init with: args: 'init "-l app"' - - name: West update + - name: West Update uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" id: west-update with: args: "update" - - name: West config Zephyr base + - name: West Config Zephyr Base uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" id: west-config with: args: 'config "--global zephyr.base-prefer configfile"' - - name: West Zephyr export + - name: West Zephyr Export uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" id: west-zephyr-export with: args: "zephyr-export" - - name: Test all + - name: Test All uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" id: west-build with: entrypoint: /bin/bash - args: '-c "west test"' - - name: Archive build + args: '-c "cd app && ./run-test.sh all"' + - name: Archive Build if: ${{ always() }} uses: actions/upload-artifact@v2 with: diff --git a/.gitignore b/.gitignore index 93c801d9..8a06510d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,3 @@ /zmk-config /build *.DS_Store -__pycache__ \ No newline at end of file diff --git a/AUTHORS b/AUTHORS index f18e97b1..8052fd95 100644 --- a/AUTHORS +++ b/AUTHORS @@ -8,5 +8,4 @@ Okke Formsma (@okke-formsma) Cody McGinnis (@BrainWart) Kurtis Lew (@kurtis-lew) Richard Jones (@bmcgavin) -Kevin Chen (@chenkevinh) -Joel Spadin (@joelspadin) +Kevin Chen (@chenkevinh) \ No newline at end of file diff --git a/README.md b/README.md index 3fc53a5c..cde1ffae 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,11 @@ [![Build](https://github.com/zmkfirmware/zmk/workflows/Build/badge.svg)](https://github.com/zmkfirmware/zmk/actions) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md) -[ZMK Firmware](https://zmkfirmware.dev/) is an open source (MIT) keyboard firmware built on the [Zephyrβ„’ Project](https://www.zephyrproject.org/) Real Time Operating System (RTOS). ZMK's goal is to provide a modern, wireless, and powerful firmware free of licensing issues. +This project is a complete work in progress, with only basic things functioning. The goal is to explore a new MK firmware +with a less restrictive license and better BLE support, built on top of the [Zephyrβ„’ Project](https://www.zephyrproject.org/) Check out the website to learn more: https://zmkfirmware.dev/ You can also come join our [ZMK Discord Server](https://zmkfirmware.dev/community/discord/invite) -To review features, check out the [feature overview](https://zmkfirmware.dev/docs/). ZMK is under active development, and new features are listed with the [enhancement label](https://github.com/zmkfirmware/zmk/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement) in GitHub. Please feel free to add πŸ‘ to the issue description of any requests to upvote the feature. +To review planned features, check out the [enhancement label](https://github.com/zmkfirmware/zmk/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement) in GitHub. Please feel free to add πŸ‘ to the issue description of any requests to upvote the feature. diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index de76e76a..7a12a812 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -30,6 +30,7 @@ target_sources(app PRIVATE src/hid.c) target_sources(app PRIVATE src/sensors.c) target_sources_ifdef(CONFIG_ZMK_DISPLAY app PRIVATE src/display.c) target_sources(app PRIVATE src/event_manager.c) +target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/ble_unpair_combo.c) target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/ext_power_generic.c) target_sources(app PRIVATE src/events/position_state_changed.c) target_sources(app PRIVATE src/events/keycode_state_changed.c) @@ -41,7 +42,6 @@ if (NOT CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL) target_sources(app PRIVATE src/behaviors/behavior_key_press.c) target_sources(app PRIVATE src/behaviors/behavior_reset.c) target_sources(app PRIVATE src/behaviors/behavior_hold_tap.c) - target_sources(app PRIVATE src/behaviors/behavior_sticky_key.c) target_sources(app PRIVATE src/behaviors/behavior_momentary_layer.c) target_sources(app PRIVATE src/behaviors/behavior_outputs.c) target_sources(app PRIVATE src/behaviors/behavior_toggle_layer.c) diff --git a/app/Kconfig b/app/Kconfig index af61f49d..28d2aa2e 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -1,6 +1,3 @@ -# Copyright (c) 2020 The ZMK Contributors -# SPDX-License-Identifier: MIT - mainmenu "ZMK Firmware" menu "ZMK" @@ -187,10 +184,6 @@ if ZMK_RGB_UNDERGLOW config SPI default y -config ZMK_RGB_UNDERGLOW_EXT_POWER - bool "RGB underglow toggling also controls external power" - default y - config ZMK_RGB_UNDERGLOW_HUE_STEP int "RGB underglow hue step in degrees of 360" default 10 @@ -224,7 +217,7 @@ config ZMK_RGB_UNDERGLOW_EFF_START default 0 config ZMK_RGB_UNDERGLOW_ON_START - bool "RGB underglow starts on by default" + bool "Whether RGB underglow starts on by default" default y #ZMK_RGB_UNDERGLOW diff --git a/app/boards/Kconfig b/app/boards/Kconfig index fe841c48..1c645e6b 100644 --- a/app/boards/Kconfig +++ b/app/boards/Kconfig @@ -1,4 +1 @@ -# Copyright (c) 2020 The ZMK Contributors -# SPDX-License-Identifier: MIT - rsource "shields/*/Kconfig.shield" diff --git a/app/boards/arm/bluemicro840/bluemicro840_v1.dts b/app/boards/arm/bluemicro840/bluemicro840_v1.dts index 18dff1af..141dbe10 100644 --- a/app/boards/arm/bluemicro840/bluemicro840_v1.dts +++ b/app/boards/arm/bluemicro840/bluemicro840_v1.dts @@ -14,6 +14,9 @@ chosen { zephyr,code-partition = &code_partition; + // zephyr,console = &uart0; + //zephyr,bt-mon-uart = &uart0; + //zephyr,bt-c2h-uart = &uart0; zephyr,sram = &sram0; zephyr,flash = &flash0; }; @@ -26,12 +29,6 @@ }; }; - ext-power { - compatible = "zmk,ext-power-generic"; - label = "EXT_POWER"; - control-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; - }; - vbatt { compatible = "zmk,battery-voltage-divider"; label = "BATTERY"; @@ -46,10 +43,6 @@ status = "okay"; }; -&gpiote { - status = "okay"; -}; - &gpio0 { status = "okay"; }; @@ -68,10 +61,10 @@ compatible = "nordic,nrf-uarte"; status = "okay"; current-speed = <115200>; - tx-pin = <19>; - rx-pin = <21>; - rts-pin = <23>; - cts-pin = <25>; + tx-pin = <39>; + rx-pin = <34>; + rts-pin = <33>; + cts-pin = <12>; }; &usbd { diff --git a/app/boards/arm/nice_nano/nice_nano.dts b/app/boards/arm/nice_nano/nice_nano.dts index 01efb289..a9bdeb30 100644 --- a/app/boards/arm/nice_nano/nice_nano.dts +++ b/app/boards/arm/nice_nano/nice_nano.dts @@ -14,6 +14,9 @@ chosen { zephyr,code-partition = &code_partition; + // zephyr,console = &uart0; + //zephyr,bt-mon-uart = &uart0; + //zephyr,bt-c2h-uart = &uart0; zephyr,sram = &sram0; zephyr,flash = &flash0; }; @@ -67,10 +70,10 @@ compatible = "nordic,nrf-uarte"; status = "okay"; current-speed = <115200>; - tx-pin = <19>; - rx-pin = <21>; - rts-pin = <23>; - cts-pin = <25>; + tx-pin = <39>; + rx-pin = <34>; + rts-pin = <33>; + cts-pin = <12>; }; &usbd { diff --git a/app/boards/arm/nrf52840_m2/nrf52840_m2.dts b/app/boards/arm/nrf52840_m2/nrf52840_m2.dts index f9354edf..e998b391 100644 --- a/app/boards/arm/nrf52840_m2/nrf52840_m2.dts +++ b/app/boards/arm/nrf52840_m2/nrf52840_m2.dts @@ -12,6 +12,9 @@ chosen { zephyr,code-partition = &code_partition; + //zephyr,console = &uart0; + //zephyr,bt-mon-uart = &uart0; + //zephyr,bt-c2h-uart = &uart0; zephyr,sram = &sram0; zephyr,flash = &flash0; }; @@ -34,14 +37,6 @@ }; -&adc { - status = "okay"; -}; - -&gpiote { - status = "okay"; -}; - &gpio0 { status = "okay"; }; @@ -51,13 +46,13 @@ }; &uart0 { - compatible = "nordic,nrf-uarte"; + compatible = "nordic,nrf-uart"; status = "okay"; current-speed = <115200>; - tx-pin = <19>; - rx-pin = <21>; - rts-pin = <23>; - cts-pin = <25>; + tx-pin = <16>; + rx-pin = <15>; + rts-pin = <14>; + cts-pin = <13>; }; &usbd { diff --git a/app/boards/arm/nrfmicro/nrfmicro_11.dts b/app/boards/arm/nrfmicro/nrfmicro_11.dts index 164b66d2..0cec6628 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_11.dts +++ b/app/boards/arm/nrfmicro/nrfmicro_11.dts @@ -33,10 +33,6 @@ }; }; -&gpiote { - status = "okay"; -}; - &gpio0 { status = "okay"; }; @@ -55,10 +51,10 @@ compatible = "nordic,nrf-uarte"; status = "okay"; current-speed = <115200>; - tx-pin = <19>; - rx-pin = <21>; - rts-pin = <23>; - cts-pin = <25>; + tx-pin = <39>; + rx-pin = <34>; + rts-pin = <33>; + cts-pin = <12>; }; &usbd { diff --git a/app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts b/app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts index fb558382..6c1bb6ae 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts +++ b/app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts @@ -33,10 +33,6 @@ }; }; -&gpiote { - status = "okay"; -}; - &gpio0 { status = "okay"; }; @@ -55,10 +51,10 @@ compatible = "nordic,nrf-uarte"; status = "okay"; current-speed = <115200>; - tx-pin = <19>; - rx-pin = <21>; - rts-pin = <23>; - cts-pin = <25>; + tx-pin = <39>; + rx-pin = <34>; + rts-pin = <33>; + cts-pin = <12>; }; &usbd { diff --git a/app/boards/arm/nrfmicro/nrfmicro_13.dts b/app/boards/arm/nrfmicro/nrfmicro_13.dts index 1a05c7a1..2910980b 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_13.dts +++ b/app/boards/arm/nrfmicro/nrfmicro_13.dts @@ -45,10 +45,6 @@ status = "okay"; }; -&gpiote { - status = "okay"; -}; - &gpio0 { status = "okay"; }; @@ -67,10 +63,10 @@ compatible = "nordic,nrf-uarte"; status = "okay"; current-speed = <115200>; - tx-pin = <19>; - rx-pin = <21>; - rts-pin = <23>; - cts-pin = <25>; + tx-pin = <39>; + rx-pin = <34>; + rts-pin = <33>; + cts-pin = <12>; }; &usbd { diff --git a/app/boards/shields/corne/boards/nice_nano.overlay b/app/boards/shields/corne/boards/nice_nano.overlay index 83ebae04..c7c3eb8e 100644 --- a/app/boards/shields/corne/boards/nice_nano.overlay +++ b/app/boards/shields/corne/boards/nice_nano.overlay @@ -1,5 +1,5 @@ &spi1 { - compatible = "nordic,nrf-spim"; + compatible = "nordic,nrf-spi"; /* Cannot be used together with i2c0. */ status = "okay"; mosi-pin = <6>; diff --git a/app/boards/shields/corne/corne.conf b/app/boards/shields/corne/corne.conf index 974243c8..b79385bd 100644 --- a/app/boards/shields/corne/corne.conf +++ b/app/boards/shields/corne/corne.conf @@ -1,5 +1,5 @@ # Uncomment the following lines to enable the Corne RGB Underglow -# CONFIG_ZMK_RGB_UNDERGLOW=y +# ZMK_RGB_UNDERGLOW=y # CONFIG_WS2812_STRIP=y # Uncomment the following line to enable the Corne OLED Display diff --git a/app/boards/shields/corne/corne.dtsi b/app/boards/shields/corne/corne.dtsi index 4360aea7..af14bae9 100644 --- a/app/boards/shields/corne/corne.dtsi +++ b/app/boards/shields/corne/corne.dtsi @@ -58,6 +58,10 @@ RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10 }; + bt_unpair_combo: bt_unpair_combo { + compatible = "zmk,bt-unpair-combo"; + }; + // TODO: per-key RGB node(s)? }; diff --git a/app/boards/shields/corne/corne_left.overlay b/app/boards/shields/corne/corne_left.overlay index 399bddd1..f12c417d 100644 --- a/app/boards/shields/corne/corne_left.overlay +++ b/app/boards/shields/corne/corne_left.overlay @@ -16,3 +16,7 @@ , <&pro_micro_d 14 GPIO_ACTIVE_HIGH> ; }; + +&bt_unpair_combo { + key-positions = <0 38>; +}; diff --git a/app/boards/shields/corne/corne_right.overlay b/app/boards/shields/corne/corne_right.overlay index 4250ac55..9d97d853 100644 --- a/app/boards/shields/corne/corne_right.overlay +++ b/app/boards/shields/corne/corne_right.overlay @@ -20,3 +20,7 @@ , <&pro_micro_a 3 GPIO_ACTIVE_HIGH> ; }; + +&bt_unpair_combo { + key-positions = <11 39>; +}; diff --git a/app/boards/shields/iris/iris.dtsi b/app/boards/shields/iris/iris.dtsi index 9ea1dd68..f6e32c40 100644 --- a/app/boards/shields/iris/iris.dtsi +++ b/app/boards/shields/iris/iris.dtsi @@ -44,4 +44,8 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,2) RC(4,9) RC(3,6) RC(3,7) ; }; + + bt_unpair_combo: bt_unpair_combo { + compatible = "zmk,bt-unpair-combo"; + }; }; \ No newline at end of file diff --git a/app/boards/shields/iris/iris_left.overlay b/app/boards/shields/iris/iris_left.overlay index 7ded678b..e04638e3 100644 --- a/app/boards/shields/iris/iris_left.overlay +++ b/app/boards/shields/iris/iris_left.overlay @@ -16,3 +16,7 @@ , <&pro_micro_d 10 GPIO_ACTIVE_HIGH> ; }; + +&bt_unpair_combo { + key-positions = <0 42>; +}; diff --git a/app/boards/shields/iris/iris_right.overlay b/app/boards/shields/iris/iris_right.overlay index 51965821..2d5dce87 100644 --- a/app/boards/shields/iris/iris_right.overlay +++ b/app/boards/shields/iris/iris_right.overlay @@ -20,3 +20,7 @@ , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> ; }; + +&bt_unpair_combo { + key-positions = <11 43>; +}; diff --git a/app/boards/shields/jian/Kconfig.defconfig b/app/boards/shields/jian/Kconfig.defconfig deleted file mode 100644 index b743e7a4..00000000 --- a/app/boards/shields/jian/Kconfig.defconfig +++ /dev/null @@ -1,23 +0,0 @@ - -if SHIELD_JIAN_LEFT - -config ZMK_KEYBOARD_NAME - default "Jian Left" - -endif - - -if SHIELD_JIAN_RIGHT - -config ZMK_KEYBOARD_NAME - default "Jian Right" - -endif - -if SHIELD_JIAN_LEFT || SHIELD_JIAN_RIGHT - -config ZMK_SPLIT - default y - - -endif diff --git a/app/boards/shields/jian/Kconfig.shield b/app/boards/shields/jian/Kconfig.shield deleted file mode 100644 index 5b874f03..00000000 --- a/app/boards/shields/jian/Kconfig.shield +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2020 The ZMK Contributors -# SPDX-License-Identifier: MIT - -config SHIELD_JIAN_LEFT - def_bool $(shields_list_contains,jian_left) - -config SHIELD_JIAN_RIGHT - def_bool $(shields_list_contains,jian_right) diff --git a/app/boards/shields/jian/jian.dtsi b/app/boards/shields/jian/jian.dtsi deleted file mode 100644 index 331624ea..00000000 --- a/app/boards/shields/jian/jian.dtsi +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include - -/ { - chosen { - zmk,kscan = &kscan0; - zmk,matrix_transform = &default_transform; - }; - - default_transform: keymap_transform_0 { - compatible = "zmk,matrix-transform"; - columns = <12>; - rows = <4>; -// | SW0 | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 | SW0 | -// | | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 | -// | | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 | -// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 | - map = < - RC(2,0) RC(0,0) RC(0,1) RC(1,2) RC(0,2) RC(0,3) RC(0,4) RC(0,7) RC(0,8) RC(0,9) RC(1,9) RC(0,10) RC(0,11) RC(2,11) - RC(1,0) RC(1,1) RC(2,2) RC(1,3) RC(1,4) RC(0,5) RC(0,6) RC(1,7) RC(1,8) RC(2,9) RC(1,10) RC(1,11) - RC(2,1) RC(3,2) RC(3,3) RC(2,3) RC(2,4) RC(1,5) RC(1,6) RC(2,7) RC(2,8) RC(3,8) RC(3,9) RC(2,10) - RC(3,4) RC(2,5) RC(3,5) RC(3,6) RC(2,6) RC(3,7) - >; - }; - - crkbd_transform: keymap_transform_1 { - compatible = "zmk,matrix-transform"; - columns = <12>; - rows = <4>; -// | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 | -// | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 | -// | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 | -// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 | - map = < - RC(0,0) RC(0,1) RC(1,2) RC(0,2) RC(0,3) RC(0,4) RC(0,7) RC(0,8) RC(0,9) RC(1,9) RC(0,10) RC(0,11) - RC(1,0) RC(1,1) RC(2,2) RC(1,3) RC(1,4) RC(0,5) RC(0,6) RC(1,7) RC(1,8) RC(2,9) RC(1,10) RC(1,11) - RC(2,1) RC(3,2) RC(3,3) RC(2,3) RC(2,4) RC(1,5) RC(1,6) RC(2,7) RC(2,8) RC(3,8) RC(3,9) RC(2,10) - RC(3,4) RC(2,5) RC(3,5) RC(3,6) RC(2,6) RC(3,7) - >; - }; - - five_column_transform: keymap_transform_2 { - compatible = "zmk,matrix-transform"; - columns = <10>; - rows = <4>; -// | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | -// | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | -// | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 | -// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 | - map = < - RC(0,1) RC(1,2) RC(0,2) RC(0,3) RC(0,4) RC(0,7) RC(0,8) RC(0,9) RC(1,9) RC(0,10) - RC(1,1) RC(2,2) RC(1,3) RC(1,4) RC(0,5) RC(0,6) RC(1,7) RC(1,8) RC(2,9) RC(1,10) - RC(3,2) RC(3,3) RC(2,3) RC(2,4) RC(1,5) RC(1,6) RC(2,7) RC(2,8) RC(3,8) RC(3,9) - RC(3,4) RC(2,5) RC(3,5) RC(3,6) RC(2,6) RC(3,7) - >; - }; - - kscan0: kscan { - compatible = "zmk,kscan-gpio-matrix"; - label = "KSCAN"; - - diode-direction = "col2row"; - row-gpios - = <&pro_micro_a 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&pro_micro_a 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&pro_micro_d 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&pro_micro_d 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - ; - - }; -}; diff --git a/app/boards/shields/jian/jian.keymap b/app/boards/shields/jian/jian.keymap deleted file mode 100644 index 256bc51a..00000000 --- a/app/boards/shields/jian/jian.keymap +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include -#include -#include - -#define DEF 0 -#define LWR 1 -#define RSE 2 -#define ADJ 3 - -/ { - keymap { - compatible = "zmk,keymap"; - - default_layer { -// ----------------------------------------------------------------------------------------- -// | GUI | ~ | Q | W | E | R | T | | Y | U | I | O | P | [ | GUI/] | -// | CTRL | A | S | D | F | G | | H | J | K | L | ; |CTRL/'| -// | LALT | Z | X | C | V | B | | N | M | , | . | / | RALT | -// | RSE | SPC | LWR | | LWR | BKSP | RSE | - bindings = < - &kp LWIN &kp GRAVE &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &mt RWIN RBKT - &kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SCLN &mt RCTRL QUOT - &kp LALT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp BSLH - < RSE TAB &mt LSHFT SPC < LWR RET < LWR ESC &mt RSHFT BSPC < RSE DEL - >; - }; - lower_layer { -// ----------------------------------------------------------------------------------------- -// | | _ | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | F12 | -// | + | ! | @ | # | $ | % | | ^ | & | * | ( | ) | - | -// | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | -// | GUI | | SPC | | ENT | | ALT | - bindings = < - &trans &kp UNDER &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &mt RGUI F12 - &mt LCTRL PLUS &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CRRT &kp AMPS &kp STAR &kp LPAR &kp RPAR &mt RCTRL MINUS - &mt LALT EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &trans - < ADJ TAB &trans &trans &trans &trans < ADJ DEL - >; - }; - - raise_layer { -// ----------------------------------------------------------------------------------------- -// | | NMLK | / | 7 | 8 | 9 | - | | VOLU| HOME| PRSC| PGUP| SCLK| CLCK| | -// | CTRL | * | 4 | 5 | 6 | + | | MUT | LEFT| UP | RGHT| INS | APP | -// | | 0 | 1 | 2 | 3 | . | | VOLD| END | DOWN| PGDN| PAUS| | -// | | | ADJ | | ADJ | | | - bindings = < - &trans &kp KP_NUM &kp KP_SLASH &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_MINUS &kp C_VOL_UP &kp HOME &kp PSCRN &kp PG_UP &kp SLCK &kp CAPS &trans - &mt LCTRL EQL &kp KP_MULTIPLY &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_PLUS &kp C_MUTE &kp LEFT &kp UP &kp RIGHT &kp INS &mt RCTRL K_APP - &trans &kp KP_N0 &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_DOT &kp C_VOL_DN &kp END &kp DOWN &kp PG_DN &kp PAUS &trans - &trans &trans < ADJ RET < ADJ ESC &trans &trans - >; - }; - adjust_layer { -// ----------------------------------------------------------------------------------------- -// | RST | BLDR | | | | | | | | | | | | BLDR | RST | -// | BTCLR| BT0 | BT1 | BT2 | BT3 | BT4 | | BT4 | BT3 | BT2 | BT1 | BT0 | BTCLR| -// | | | | | | | | | | | | | | -// | | | | | | | | - bindings = < - &reset &bootloader &none &none &none &none &none &none &none &none &none &none &bootloader &reset - &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_SEL 4 &bt BT_SEL 3 &bt BT_SEL 2 &bt BT_SEL 1 &bt BT_SEL 0 &bt BT_CLR - &none &none &none &none &none &none &none &none &none &none &none &none - &trans &none &trans &trans &none &trans - >; - }; - }; -}; diff --git a/app/boards/shields/jian/jian_left.conf b/app/boards/shields/jian/jian_left.conf deleted file mode 100644 index 1e028a78..00000000 --- a/app/boards/shields/jian/jian_left.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_ZMK_SPLIT=y -CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y diff --git a/app/boards/shields/jian/jian_left.overlay b/app/boards/shields/jian/jian_left.overlay deleted file mode 100644 index 553dbd05..00000000 --- a/app/boards/shields/jian/jian_left.overlay +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include "jian.dtsi" - -&kscan0 { - col-gpios - = <&pro_micro_d 1 GPIO_ACTIVE_HIGH> - , <&pro_micro_d 0 GPIO_ACTIVE_HIGH> - , <&pro_micro_d 8 GPIO_ACTIVE_HIGH> - , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> - , <&pro_micro_a 0 GPIO_ACTIVE_HIGH> - , <&pro_micro_d 16 GPIO_ACTIVE_HIGH> - ; -}; diff --git a/app/boards/shields/jian/jian_right.conf b/app/boards/shields/jian/jian_right.conf deleted file mode 100644 index 990cf7c0..00000000 --- a/app/boards/shields/jian/jian_right.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_ZMK_SPLIT=y -CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL=y diff --git a/app/boards/shields/jian/jian_right.overlay b/app/boards/shields/jian/jian_right.overlay deleted file mode 100644 index 1430b817..00000000 --- a/app/boards/shields/jian/jian_right.overlay +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include "jian.dtsi" - -&default_transform { - col-offset = <6>; -}; - -&kscan0 { - col-gpios - = <&pro_micro_d 16 GPIO_ACTIVE_HIGH> - , <&pro_micro_a 0 GPIO_ACTIVE_HIGH> - , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> - , <&pro_micro_d 8 GPIO_ACTIVE_HIGH> - , <&pro_micro_d 0 GPIO_ACTIVE_HIGH> - , <&pro_micro_d 1 GPIO_ACTIVE_HIGH> - ; -}; diff --git a/app/boards/shields/jorne/Kconfig.defconfig b/app/boards/shields/jorne/Kconfig.defconfig deleted file mode 100644 index a8cf29b8..00000000 --- a/app/boards/shields/jorne/Kconfig.defconfig +++ /dev/null @@ -1,58 +0,0 @@ - -if SHIELD_JORNE_LEFT - -config ZMK_KEYBOARD_NAME - default "Jorne Left" - -endif - - -if SHIELD_JORNE_RIGHT - -config ZMK_KEYBOARD_NAME - default "Jorne Right" - -endif - -if SHIELD_JORNE_LEFT || SHIELD_JORNE_RIGHT - -config ZMK_SPLIT - default y - -if ZMK_DISPLAY - -config I2C - default y - -config SSD1306 - default y - -config SSD1306_REVERSE_MODE - default y - -endif # ZMK_DISPLAY - -if LVGL - -config LVGL_HOR_RES - default 128 - -config LVGL_VER_RES - default 32 - -config LVGL_VDB_SIZE - default 64 - -config LVGL_DPI - default 148 - -config LVGL_BITS_PER_PIXEL - default 1 - -choice LVGL_COLOR_DEPTH - default LVGL_COLOR_DEPTH_1 -endchoice - -endif # LVGL - -endif diff --git a/app/boards/shields/jorne/Kconfig.shield b/app/boards/shields/jorne/Kconfig.shield deleted file mode 100644 index 11766113..00000000 --- a/app/boards/shields/jorne/Kconfig.shield +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2020 The ZMK Contributors -# SPDX-License-Identifier: MIT - -config SHIELD_JORNE_LEFT - def_bool $(shields_list_contains,jorne_left) - -config SHIELD_JORNE_RIGHT - def_bool $(shields_list_contains,jorne_right) diff --git a/app/boards/shields/jorne/boards/nice_nano.overlay b/app/boards/shields/jorne/boards/nice_nano.overlay deleted file mode 100644 index 03b868ce..00000000 --- a/app/boards/shields/jorne/boards/nice_nano.overlay +++ /dev/null @@ -1,29 +0,0 @@ -&spi1 { - compatible = "nordic,nrf-spim"; - /* Cannot be used together with i2c0. */ - status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; - - led_strip: ws2812@0 { - compatible = "worldsemi,ws2812-spi"; - label = "WS2812"; - - /* SPI */ - reg = <0>; /* ignored, but necessary for SPI bindings */ - spi-max-frequency = <4000000>; - - /* WS2812 */ - chain-length = <6>; /* There are per-key RGB, but the first 6 are underglow */ - spi-one-frame = <0x70>; - spi-zero-frame = <0x40>; - }; -}; - -/ { - chosen { - zmk,underglow = &led_strip; - }; -}; diff --git a/app/boards/shields/jorne/jorne.conf b/app/boards/shields/jorne/jorne.conf deleted file mode 100644 index c4e62fc0..00000000 --- a/app/boards/shields/jorne/jorne.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Uncomment the following lines to enable the Jorne RGB Underglow -# CONFIG_ZMK_RGB_UNDERGLOW=y -# CONFIG_WS2812_STRIP=y - -# Uncomment the following line to enable the Jorne OLED Display -# CONFIG_ZMK_DISPLAY=y diff --git a/app/boards/shields/jorne/jorne.dtsi b/app/boards/shields/jorne/jorne.dtsi deleted file mode 100644 index 7e6cfd8b..00000000 --- a/app/boards/shields/jorne/jorne.dtsi +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include - -/ { - chosen { - zmk,kscan = &kscan0; - zmk,matrix_transform = &default_transform; - }; - - default_transform: keymap_transform_0 { - compatible = "zmk,matrix-transform"; - columns = <12>; - rows = <4>; -// | SW0 | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 | SW0 | -// | | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 | -// | | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 | -// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 | - map = < - RC(3,0) RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(3,11) - RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) - RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) - RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) - >; - }; - - crkbd_transform: keymap_transform_1 { - compatible = "zmk,matrix-transform"; - columns = <12>; - rows = <4>; -// | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 | -// | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 | -// | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 | -// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 | - map = < - RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) - RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) - RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) - RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) - >; - }; - - five_column_transform: keymap_transform_2 { - compatible = "zmk,matrix-transform"; - columns = <10>; - rows = <4>; -// | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | -// | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | -// | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 | -// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 | - map = < -RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) -RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) -RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) - RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) - >; - }; - - kscan0: kscan { - compatible = "zmk,kscan-gpio-matrix"; - label = "KSCAN"; - - diode-direction = "col2row"; - row-gpios - = <&pro_micro_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&pro_micro_d 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - ; - - }; - - // TODO: per-key RGB node(s)? -}; - -&pro_micro_i2c { - status = "okay"; - - oled: ssd1306@3c { - compatible = "solomon,ssd1306fb"; - reg = <0x3c>; - label = "DISPLAY"; - width = <128>; - height = <32>; - segment-offset = <0>; - page-offset = <0>; - display-offset = <0>; - multiplex-ratio = <31>; - segment-remap; - com-invdir; - com-sequential; - prechargep = <0x22>; - }; -}; diff --git a/app/boards/shields/jorne/jorne.keymap b/app/boards/shields/jorne/jorne.keymap deleted file mode 100644 index 256bc51a..00000000 --- a/app/boards/shields/jorne/jorne.keymap +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include -#include -#include - -#define DEF 0 -#define LWR 1 -#define RSE 2 -#define ADJ 3 - -/ { - keymap { - compatible = "zmk,keymap"; - - default_layer { -// ----------------------------------------------------------------------------------------- -// | GUI | ~ | Q | W | E | R | T | | Y | U | I | O | P | [ | GUI/] | -// | CTRL | A | S | D | F | G | | H | J | K | L | ; |CTRL/'| -// | LALT | Z | X | C | V | B | | N | M | , | . | / | RALT | -// | RSE | SPC | LWR | | LWR | BKSP | RSE | - bindings = < - &kp LWIN &kp GRAVE &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &mt RWIN RBKT - &kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SCLN &mt RCTRL QUOT - &kp LALT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp BSLH - < RSE TAB &mt LSHFT SPC < LWR RET < LWR ESC &mt RSHFT BSPC < RSE DEL - >; - }; - lower_layer { -// ----------------------------------------------------------------------------------------- -// | | _ | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | F12 | -// | + | ! | @ | # | $ | % | | ^ | & | * | ( | ) | - | -// | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | -// | GUI | | SPC | | ENT | | ALT | - bindings = < - &trans &kp UNDER &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &mt RGUI F12 - &mt LCTRL PLUS &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CRRT &kp AMPS &kp STAR &kp LPAR &kp RPAR &mt RCTRL MINUS - &mt LALT EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &trans - < ADJ TAB &trans &trans &trans &trans < ADJ DEL - >; - }; - - raise_layer { -// ----------------------------------------------------------------------------------------- -// | | NMLK | / | 7 | 8 | 9 | - | | VOLU| HOME| PRSC| PGUP| SCLK| CLCK| | -// | CTRL | * | 4 | 5 | 6 | + | | MUT | LEFT| UP | RGHT| INS | APP | -// | | 0 | 1 | 2 | 3 | . | | VOLD| END | DOWN| PGDN| PAUS| | -// | | | ADJ | | ADJ | | | - bindings = < - &trans &kp KP_NUM &kp KP_SLASH &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_MINUS &kp C_VOL_UP &kp HOME &kp PSCRN &kp PG_UP &kp SLCK &kp CAPS &trans - &mt LCTRL EQL &kp KP_MULTIPLY &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_PLUS &kp C_MUTE &kp LEFT &kp UP &kp RIGHT &kp INS &mt RCTRL K_APP - &trans &kp KP_N0 &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_DOT &kp C_VOL_DN &kp END &kp DOWN &kp PG_DN &kp PAUS &trans - &trans &trans < ADJ RET < ADJ ESC &trans &trans - >; - }; - adjust_layer { -// ----------------------------------------------------------------------------------------- -// | RST | BLDR | | | | | | | | | | | | BLDR | RST | -// | BTCLR| BT0 | BT1 | BT2 | BT3 | BT4 | | BT4 | BT3 | BT2 | BT1 | BT0 | BTCLR| -// | | | | | | | | | | | | | | -// | | | | | | | | - bindings = < - &reset &bootloader &none &none &none &none &none &none &none &none &none &none &bootloader &reset - &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_SEL 4 &bt BT_SEL 3 &bt BT_SEL 2 &bt BT_SEL 1 &bt BT_SEL 0 &bt BT_CLR - &none &none &none &none &none &none &none &none &none &none &none &none - &trans &none &trans &trans &none &trans - >; - }; - }; -}; diff --git a/app/boards/shields/jorne/jorne_left.conf b/app/boards/shields/jorne/jorne_left.conf deleted file mode 100644 index 1e028a78..00000000 --- a/app/boards/shields/jorne/jorne_left.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_ZMK_SPLIT=y -CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y diff --git a/app/boards/shields/jorne/jorne_left.overlay b/app/boards/shields/jorne/jorne_left.overlay deleted file mode 100644 index ca6ad431..00000000 --- a/app/boards/shields/jorne/jorne_left.overlay +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include "jorne.dtsi" - -&kscan0 { - col-gpios - = <&pro_micro_a 3 GPIO_ACTIVE_HIGH> - , <&pro_micro_a 2 GPIO_ACTIVE_HIGH> - , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> - , <&pro_micro_a 0 GPIO_ACTIVE_HIGH> - , <&pro_micro_d 15 GPIO_ACTIVE_HIGH> - , <&pro_micro_d 14 GPIO_ACTIVE_HIGH> - ; -}; diff --git a/app/boards/shields/jorne/jorne_right.conf b/app/boards/shields/jorne/jorne_right.conf deleted file mode 100644 index 990cf7c0..00000000 --- a/app/boards/shields/jorne/jorne_right.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_ZMK_SPLIT=y -CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL=y diff --git a/app/boards/shields/jorne/jorne_right.overlay b/app/boards/shields/jorne/jorne_right.overlay deleted file mode 100644 index 6ae232eb..00000000 --- a/app/boards/shields/jorne/jorne_right.overlay +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include "jorne.dtsi" - -&default_transform { - col-offset = <6>; -}; - -&kscan0 { - col-gpios - = <&pro_micro_d 14 GPIO_ACTIVE_HIGH> - , <&pro_micro_d 15 GPIO_ACTIVE_HIGH> - , <&pro_micro_a 0 GPIO_ACTIVE_HIGH> - , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> - , <&pro_micro_a 2 GPIO_ACTIVE_HIGH> - , <&pro_micro_a 3 GPIO_ACTIVE_HIGH> - ; -}; diff --git a/app/boards/shields/kyria/boards/nice_nano.overlay b/app/boards/shields/kyria/boards/nice_nano.overlay index 8be964b5..f51ecfeb 100644 --- a/app/boards/shields/kyria/boards/nice_nano.overlay +++ b/app/boards/shields/kyria/boards/nice_nano.overlay @@ -1,5 +1,5 @@ &spi1 { - compatible = "nordic,nrf-spim"; + compatible = "nordic,nrf-spi"; status = "okay"; mosi-pin = <6>; // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. diff --git a/app/boards/shields/kyria/boards/nrfmicro_11.overlay b/app/boards/shields/kyria/boards/nrfmicro_11.overlay index b88573b6..d7f724f6 100644 --- a/app/boards/shields/kyria/boards/nrfmicro_11.overlay +++ b/app/boards/shields/kyria/boards/nrfmicro_11.overlay @@ -1,5 +1,5 @@ &spi1 { - compatible = "nordic,nrf-spim"; + compatible = "nordic,nrf-spi"; status = "okay"; mosi-pin = <6>; // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. diff --git a/app/boards/shields/kyria/boards/nrfmicro_11_flipped.overlay b/app/boards/shields/kyria/boards/nrfmicro_11_flipped.overlay index c6a24665..c5f2a940 100644 --- a/app/boards/shields/kyria/boards/nrfmicro_11_flipped.overlay +++ b/app/boards/shields/kyria/boards/nrfmicro_11_flipped.overlay @@ -1,5 +1,5 @@ &spi1 { - compatible = "nordic,nrf-spim"; + compatible = "nordic,nrf-spi"; status = "okay"; mosi-pin = <6>; // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. diff --git a/app/boards/shields/kyria/boards/nrfmicro_13.overlay b/app/boards/shields/kyria/boards/nrfmicro_13.overlay index c6a24665..c5f2a940 100644 --- a/app/boards/shields/kyria/boards/nrfmicro_13.overlay +++ b/app/boards/shields/kyria/boards/nrfmicro_13.overlay @@ -1,5 +1,5 @@ &spi1 { - compatible = "nordic,nrf-spim"; + compatible = "nordic,nrf-spi"; status = "okay"; mosi-pin = <6>; // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. diff --git a/app/boards/shields/kyria/kyria.dtsi b/app/boards/shields/kyria/kyria.dtsi index bbead846..a13f7f08 100644 --- a/app/boards/shields/kyria/kyria.dtsi +++ b/app/boards/shields/kyria/kyria.dtsi @@ -81,6 +81,10 @@ RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) sensors = <&left_encoder &right_encoder>; }; + bt_unpair_combo: bt_unpair_combo { + compatible = "zmk,bt-unpair-combo"; + }; + // TODO: RGB node(s) }; diff --git a/app/boards/shields/kyria/kyria_left.overlay b/app/boards/shields/kyria/kyria_left.overlay index c8b5be27..441c1a69 100644 --- a/app/boards/shields/kyria/kyria_left.overlay +++ b/app/boards/shields/kyria/kyria_left.overlay @@ -22,3 +22,7 @@ &left_encoder { status = "okay"; }; + +&bt_unpair_combo { + key-positions = <0 44>; +}; \ No newline at end of file diff --git a/app/boards/shields/kyria/kyria_right.overlay b/app/boards/shields/kyria/kyria_right.overlay index 8163c95e..8ee0fcbc 100644 --- a/app/boards/shields/kyria/kyria_right.overlay +++ b/app/boards/shields/kyria/kyria_right.overlay @@ -27,3 +27,7 @@ &right_encoder { status = "okay"; }; + +&bt_unpair_combo { + key-positions = <11 45>; +}; \ No newline at end of file diff --git a/app/boards/shields/lily58/lily58.dtsi b/app/boards/shields/lily58/lily58.dtsi index eb69fa75..556909fd 100644 --- a/app/boards/shields/lily58/lily58.dtsi +++ b/app/boards/shields/lily58/lily58.dtsi @@ -57,6 +57,10 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,5) RC(4,6) RC(3,6) RC(3,7) compatible = "zmk,keymap-sensors"; sensors = <&left_encoder>; }; + + bt_unpair_combo: bt_unpair_combo { + compatible = "zmk,bt-unpair-combo"; + }; }; &pro_micro_i2c { diff --git a/app/boards/shields/lily58/lily58_left.overlay b/app/boards/shields/lily58/lily58_left.overlay index 7397f188..1752b6e4 100644 --- a/app/boards/shields/lily58/lily58_left.overlay +++ b/app/boards/shields/lily58/lily58_left.overlay @@ -20,3 +20,7 @@ &left_encoder { status = "okay"; }; + +&bt_unpair_combo { + key-positions = <0 53>; +}; diff --git a/app/boards/shields/lily58/lily58_right.overlay b/app/boards/shields/lily58/lily58_right.overlay index 4fc460cf..6c8e493d 100644 --- a/app/boards/shields/lily58/lily58_right.overlay +++ b/app/boards/shields/lily58/lily58_right.overlay @@ -20,3 +20,7 @@ , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> ; }; + +&bt_unpair_combo { + key-positions = <11 54>; +}; diff --git a/app/boards/shields/m60/m60.overlay b/app/boards/shields/m60/m60.overlay index 0824f1c6..babae2db 100644 --- a/app/boards/shields/m60/m60.overlay +++ b/app/boards/shields/m60/m60.overlay @@ -56,5 +56,11 @@ RC(6,4) RC(6,3) RC(6,2) RC(6,1) RC(6,0) RC(5,7) RC(5,6) RC(5,5) RC(5,4) RC RC(6,5) RC(6,6) RC(6,7) RC(7,0) RC(7,1) RC(7,2) RC(7,3) RC(7,4) >; }; + + bt_unpair_combo: bt_unpair_combo { + compatible = "zmk,bt-unpair-combo"; + key-positions = <0 53>; + }; + }; diff --git a/app/boards/shields/microdox/boards/nice_nano.overlay b/app/boards/shields/microdox/boards/nice_nano.overlay index 1b84b6b5..58cd8613 100644 --- a/app/boards/shields/microdox/boards/nice_nano.overlay +++ b/app/boards/shields/microdox/boards/nice_nano.overlay @@ -4,7 +4,7 @@ * SPDX-License-Identifier: MIT */ &spi1 { - compatible = "nordic,nrf-spim"; + compatible = "nordic,nrf-spi"; /* Cannot be used together with i2c0. */ status = "okay"; mosi-pin = <6>; diff --git a/app/boards/shields/microdox/microdox.conf b/app/boards/shields/microdox/microdox.conf index 0d38398c..b79385bd 100644 --- a/app/boards/shields/microdox/microdox.conf +++ b/app/boards/shields/microdox/microdox.conf @@ -1,6 +1,6 @@ -# Uncomment the following lines to enable the Microdox RGB Underglow -# CONFIG_ZMK_RGB_UNDERGLOW=y +# Uncomment the following lines to enable the Corne RGB Underglow +# ZMK_RGB_UNDERGLOW=y # CONFIG_WS2812_STRIP=y -# Uncomment the following line to enable the Microdox OLED Display +# Uncomment the following line to enable the Corne OLED Display # CONFIG_ZMK_DISPLAY=y diff --git a/app/boards/shields/qaz/qaz.keymap b/app/boards/shields/qaz/qaz.keymap index 5dca247b..36229727 100644 --- a/app/boards/shields/qaz/qaz.keymap +++ b/app/boards/shields/qaz/qaz.keymap @@ -31,27 +31,27 @@ default_layer { bindings = < - &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P - &hm LGUI A &hm LALT S &hm LCTL D &hm LSFT F &kp G &kp H &hm RSFT J &hm RCTL K &hm RALT L &hm RGUI RET - &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp CMMA &kp DOT - &kp LSFT &kp LGUI &kp LALT < NAV RET < NUM_SYM SPC &kp COLN &kp QUOT &kp FSLH + &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P + &hm LGUI A &hm LALT S &hm LCTL D &hm LSFT F &kp G &kp H &hm RSFT J &hm RCTL K &hm RALT L &hm RGUI RET + &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp CMMA &kp DOT + &kp LSFT &kp LGUI &kp LALT < NAV RET < NUM_SYM SPC &kp COLN &kp QUOT &kp FSLH >; }; num_sym { bindings = < - &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 - &trans &trans &trans &trans &trans &trans &trans &trans &kp EQL &kp MINUS - &kp DEL &none &none &none &none &none &none &none &kp DOT - &bootloader &reset &none &trans &trans &kp RET &trans &kp FSLH + &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp NUM_0 + &trans &trans &trans &trans &trans &trans &trans &trans &kp EQL &kp MINUS + &kp DEL &none &none &none &none &none &none &none &kp DOT + &bootloader &reset &none &trans &trans &kp RET &trans &kp FSLH >; }; nav { bindings = < - &bt BT_CLR &bt BT_NXT &bt BT_PRV &none &none &none &none &kp UARW &none &kp BKSP - &trans &trans &trans &trans &none &none &kp LARW &kp DARW &kp RARW &none - &none &none &none &none &none &none &none &none &none - &none &none &none &trans &trans &kp RET &trans &kp FSLH + &bt BT_CLR &bt BT_NXT &bt BT_PRV &none &none &none &none &kp UARW &none &kp BKSP + &trans &trans &trans &trans &none &none &kp LARW &kp DARW &kp RARW &none + &none &none &none &none &none &none &none &none &none + &none &none &none &trans &trans &kp RET &trans &kp FSLH >; }; }; diff --git a/app/boards/shields/reviung41/boards/nice_nano.overlay b/app/boards/shields/reviung41/boards/nice_nano.overlay index b6c89e80..a05d0eba 100644 --- a/app/boards/shields/reviung41/boards/nice_nano.overlay +++ b/app/boards/shields/reviung41/boards/nice_nano.overlay @@ -1,5 +1,5 @@ &spi1 { - compatible = "nordic,nrf-spim"; + compatible = "nordic,nrf-spi"; status = "okay"; mosi-pin = <6>; // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. diff --git a/app/boards/shields/romac/romac.overlay b/app/boards/shields/romac/romac.overlay index f6b0f726..67d5868b 100644 --- a/app/boards/shields/romac/romac.overlay +++ b/app/boards/shields/romac/romac.overlay @@ -30,5 +30,11 @@ ; }; + + bt_unpair_combo: bt_unpair_combo { + compatible = "zmk,bt-unpair-combo"; + key-positions = <0 11>; + }; + }; diff --git a/app/boards/shields/romac_plus/boards/nice_nano.overlay b/app/boards/shields/romac_plus/boards/nice_nano.overlay index 17d11927..a8dafa2d 100644 --- a/app/boards/shields/romac_plus/boards/nice_nano.overlay +++ b/app/boards/shields/romac_plus/boards/nice_nano.overlay @@ -1,5 +1,5 @@ &spi1 { - compatible = "nordic,nrf-spim"; + compatible = "nordic,nrf-spi"; status = "okay"; mosi-pin = <6>; // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. diff --git a/app/boards/shields/sofle/sofle.dtsi b/app/boards/shields/sofle/sofle.dtsi index b4edb5f6..bff42f6f 100644 --- a/app/boards/shields/sofle/sofle.dtsi +++ b/app/boards/shields/sofle/sofle.dtsi @@ -66,6 +66,10 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,5) RC(4,6) RC(3,6) RC(3,7) compatible = "zmk,keymap-sensors"; sensors = <&left_encoder &right_encoder>; }; + + bt_unpair_combo: bt_unpair_combo { + compatible = "zmk,bt-unpair-combo"; + }; }; &pro_micro_i2c { diff --git a/app/boards/shields/sofle/sofle_left.overlay b/app/boards/shields/sofle/sofle_left.overlay index eb2bfeda..0dfb7535 100644 --- a/app/boards/shields/sofle/sofle_left.overlay +++ b/app/boards/shields/sofle/sofle_left.overlay @@ -20,3 +20,7 @@ &left_encoder { status = "okay"; }; + +&bt_unpair_combo { + key-positions = <0 54>; +}; diff --git a/app/boards/shields/sofle/sofle_right.overlay b/app/boards/shields/sofle/sofle_right.overlay index c35cf52c..8eaf076d 100644 --- a/app/boards/shields/sofle/sofle_right.overlay +++ b/app/boards/shields/sofle/sofle_right.overlay @@ -24,3 +24,7 @@ &right_encoder { status = "okay"; }; + +&bt_unpair_combo { + key-positions = <11 55>; +}; diff --git a/app/cmake/zmk_config.cmake b/app/cmake/zmk_config.cmake index 145352a3..017dd111 100644 --- a/app/cmake/zmk_config.cmake +++ b/app/cmake/zmk_config.cmake @@ -5,8 +5,6 @@ # * single overlay, # * or per board/shield. -cmake_minimum_required(VERSION 3.15) - get_property(cached_user_config_value CACHE ZMK_CONFIG PROPERTY VALUE) set(user_config_cli_argument ${cached_user_config_value}) # Either new or old diff --git a/app/drivers/zephyr/Kconfig b/app/drivers/zephyr/Kconfig index b8b2b1be..6b177fb1 100644 --- a/app/drivers/zephyr/Kconfig +++ b/app/drivers/zephyr/Kconfig @@ -1,6 +1,3 @@ -# Copyright (c) 2020 The ZMK Contributors -# SPDX-License-Identifier: MIT - config ZMK_KSCAN_GPIO_DRIVER bool "Enable GPIO kscan driver to simulate key presses" default y diff --git a/app/drivers/zephyr/battery_voltage_divider.c b/app/drivers/zephyr/battery_voltage_divider.c index d634dfd9..b94e2a27 100644 --- a/app/drivers/zephyr/battery_voltage_divider.c +++ b/app/drivers/zephyr/battery_voltage_divider.c @@ -205,8 +205,8 @@ static const struct bvd_config bvd_cfg = { .power_gpios = { DT_INST_GPIO_LABEL(0, power_gpios), - DT_INST_GPIO_PIN(0, power_gpios), - DT_INST_GPIO_FLAGS(0, power_gpios), + DT_INST_PIN(0, power_gpios), + DT_INST_FLAGS(0, power_gpios), }, #endif .output_ohm = DT_INST_PROP(0, output_ohms), diff --git a/app/drivers/zephyr/module.yml b/app/drivers/zephyr/module.yaml similarity index 100% rename from app/drivers/zephyr/module.yml rename to app/drivers/zephyr/module.yaml diff --git a/app/dts/behaviors.dtsi b/app/dts/behaviors.dtsi index 9a64fc6c..a120b84b 100644 --- a/app/dts/behaviors.dtsi +++ b/app/dts/behaviors.dtsi @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include diff --git a/app/dts/behaviors/bluetooth.dtsi b/app/dts/behaviors/bluetooth.dtsi index 9df974b4..ea09f4a2 100644 --- a/app/dts/behaviors/bluetooth.dtsi +++ b/app/dts/behaviors/bluetooth.dtsi @@ -1,9 +1,3 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - / { behaviors { bt: behavior_bluetooth { diff --git a/app/dts/behaviors/ext_power.dtsi b/app/dts/behaviors/ext_power.dtsi index 471e9fa2..92f00352 100644 --- a/app/dts/behaviors/ext_power.dtsi +++ b/app/dts/behaviors/ext_power.dtsi @@ -1,9 +1,3 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - / { behaviors { ext_power: behavior_ext_power { diff --git a/app/dts/behaviors/key_press.dtsi b/app/dts/behaviors/key_press.dtsi index 98064f69..77050aaa 100644 --- a/app/dts/behaviors/key_press.dtsi +++ b/app/dts/behaviors/key_press.dtsi @@ -1,8 +1,5 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ + +#include / { behaviors { diff --git a/app/dts/behaviors/layer_tap.dtsi b/app/dts/behaviors/layer_tap.dtsi index cca481a7..af7319b3 100644 --- a/app/dts/behaviors/layer_tap.dtsi +++ b/app/dts/behaviors/layer_tap.dtsi @@ -1,9 +1,3 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - / { behaviors { lt: behavior_layer_tap { diff --git a/app/dts/behaviors/mod_tap.dtsi b/app/dts/behaviors/mod_tap.dtsi index b972aba1..4ce732b4 100644 --- a/app/dts/behaviors/mod_tap.dtsi +++ b/app/dts/behaviors/mod_tap.dtsi @@ -1,9 +1,3 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - / { behaviors { mt: behavior_mod_tap { diff --git a/app/dts/behaviors/momentary_layer.dtsi b/app/dts/behaviors/momentary_layer.dtsi index d3b21da9..e5b6c3ce 100644 --- a/app/dts/behaviors/momentary_layer.dtsi +++ b/app/dts/behaviors/momentary_layer.dtsi @@ -1,9 +1,3 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - / { behaviors { mo: behavior_momentary_layer { diff --git a/app/dts/behaviors/none.dtsi b/app/dts/behaviors/none.dtsi index 1fe2cff7..e84ed491 100644 --- a/app/dts/behaviors/none.dtsi +++ b/app/dts/behaviors/none.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 The ZMK Contributors + * Copyright (c) 2020 Pete Johanson * * SPDX-License-Identifier: MIT */ diff --git a/app/dts/behaviors/outputs.dtsi b/app/dts/behaviors/outputs.dtsi index ee17e1df..a534cbf9 100644 --- a/app/dts/behaviors/outputs.dtsi +++ b/app/dts/behaviors/outputs.dtsi @@ -1,9 +1,3 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - / { behaviors { out: behavior_outputs { diff --git a/app/dts/behaviors/reset.dtsi b/app/dts/behaviors/reset.dtsi index cf363425..fc4fa149 100644 --- a/app/dts/behaviors/reset.dtsi +++ b/app/dts/behaviors/reset.dtsi @@ -1,9 +1,3 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - #include / { diff --git a/app/dts/behaviors/rgb_underglow.dtsi b/app/dts/behaviors/rgb_underglow.dtsi index 22aff93f..e8ad9da8 100644 --- a/app/dts/behaviors/rgb_underglow.dtsi +++ b/app/dts/behaviors/rgb_underglow.dtsi @@ -1,9 +1,3 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - / { behaviors { rgb_ug: behavior_rgb_underglow { diff --git a/app/dts/behaviors/sensor_rotate_key_press.dtsi b/app/dts/behaviors/sensor_rotate_key_press.dtsi index 075fc38e..54339945 100644 --- a/app/dts/behaviors/sensor_rotate_key_press.dtsi +++ b/app/dts/behaviors/sensor_rotate_key_press.dtsi @@ -1,8 +1,5 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ + +#include / { behaviors { diff --git a/app/dts/behaviors/sticky_key.dtsi b/app/dts/behaviors/sticky_key.dtsi deleted file mode 100644 index 1e66a1ed..00000000 --- a/app/dts/behaviors/sticky_key.dtsi +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -/ { - behaviors { - sk: behavior_sticky_key { - compatible = "zmk,behavior-sticky-key"; - label = "STICKY_KEY"; - #binding-cells = <1>; - release-after-ms = <1000>; - bindings = <&kp>; - }; - sl: behavior_sticky_layer { - compatible = "zmk,behavior-sticky-key"; - label = "STICKY_LAYER"; - #binding-cells = <1>; - release-after-ms = <1000>; - bindings = <&mo>; - }; - }; - -}; - diff --git a/app/dts/behaviors/transparent.dtsi b/app/dts/behaviors/transparent.dtsi index 09f9ea00..ddd05220 100644 --- a/app/dts/behaviors/transparent.dtsi +++ b/app/dts/behaviors/transparent.dtsi @@ -1,9 +1,3 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - / { behaviors { trans: behavior_transparent { diff --git a/app/dts/bindings/behaviors/zmk,behavior-sticky-key.yaml b/app/dts/bindings/behaviors/zmk,behavior-sticky-key.yaml deleted file mode 100644 index d73a107d..00000000 --- a/app/dts/bindings/behaviors/zmk,behavior-sticky-key.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2020 The ZMK Contributors -# SPDX-License-Identifier: MIT - -description: Sticky key behavior - -compatible: "zmk,behavior-sticky-key" - -include: one_param.yaml - -properties: - bindings: - type: phandles - required: true - release-after-ms: - type: int \ No newline at end of file diff --git a/app/dts/bindings/zmk,bt-unpair-combo.yaml b/app/dts/bindings/zmk,bt-unpair-combo.yaml new file mode 100644 index 00000000..d781347a --- /dev/null +++ b/app/dts/bindings/zmk,bt-unpair-combo.yaml @@ -0,0 +1,12 @@ +# Copyright (c) 2020, Pete Johanson +# SPDX-License-Identifier: MIT + +description: | + Defines a set of key positions that will unpair all BT devices if held on startup. + +compatible: "zmk,bt-unpair-combo" + +properties: + key-positions: + type: array + required: true diff --git a/app/include/drivers/behavior.h b/app/include/drivers/behavior.h index 39561a2d..cf259b13 100644 --- a/app/include/drivers/behavior.h +++ b/app/include/drivers/behavior.h @@ -23,7 +23,7 @@ typedef int (*behavior_keymap_binding_callback_t)(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event); typedef int (*behavior_sensor_keymap_binding_callback_t)(struct zmk_behavior_binding *binding, - struct device *sensor, s64_t timestamp); + struct device *sensor); __subsystem struct behavior_driver_api { behavior_keymap_binding_callback_t binding_pressed; @@ -92,11 +92,11 @@ static inline int z_impl_behavior_keymap_binding_released(struct zmk_behavior_bi * @retval Negative errno code if failure. */ __syscall int behavior_sensor_keymap_binding_triggered(struct zmk_behavior_binding *binding, - struct device *sensor, s64_t timestamp); + struct device *sensor); static inline int z_impl_behavior_sensor_keymap_binding_triggered(struct zmk_behavior_binding *binding, - struct device *sensor, s64_t timestamp) { + struct device *sensor) { struct device *dev = device_get_binding(binding->behavior_dev); const struct behavior_driver_api *api = (const struct behavior_driver_api *)dev->driver_api; @@ -104,7 +104,7 @@ z_impl_behavior_sensor_keymap_binding_triggered(struct zmk_behavior_binding *bin return -ENOTSUP; } - return api->sensor_binding_triggered(binding, sensor, timestamp); + return api->sensor_binding_triggered(binding, sensor); } /** diff --git a/app/include/dt-bindings/zmk/hid_usage_pages.h b/app/include/dt-bindings/zmk/hid_usage_pages.h index f38f4fd3..5b3cb556 100644 --- a/app/include/dt-bindings/zmk/hid_usage_pages.h +++ b/app/include/dt-bindings/zmk/hid_usage_pages.h @@ -10,9 +10,9 @@ #pragma once -#define HID_USAGE(page, id) ((page << 16) | id) -#define HID_USAGE_ID(usage) (usage & 0xFFFF) -#define HID_USAGE_PAGE(usage) (usage >> 16) +#define HID_EXT_USAGE(page, id) ((page << 16) | id) +#define HID_EXT_USAGE_ID(ext) (ext & 0xFFFF) +#define HID_EXT_USAGE_PAGE(ext) (ext >> 16) /* WARNING: DEPRECATED from dt-bindings/zmk/keys.h */ #define USAGE_KEYPAD (0x07) // WARNING: DEPRECATED (DO NOT USE) diff --git a/app/include/dt-bindings/zmk/keys.h b/app/include/dt-bindings/zmk/keys.h index 8d0873c4..1bb43b91 100644 --- a/app/include/dt-bindings/zmk/keys.h +++ b/app/include/dt-bindings/zmk/keys.h @@ -10,773 +10,776 @@ #include /* System Power Down */ -#define SYSTEM_POWER (HID_USAGE(HID_USAGE_GD, HID_USAGE_GD_SYSTEM_POWER_DOWN)) +#define SYSTEM_POWER (HID_EXT_USAGE(HID_USAGE_GD, HID_USAGE_GD_SYSTEM_POWER_DOWN)) #define SYS_PWR (SYSTEM_POWER) /* System Sleep */ -#define SYSTEM_SLEEP (HID_USAGE(HID_USAGE_GD, HID_USAGE_GD_SYSTEM_SLEEP)) +#define SYSTEM_SLEEP (HID_EXT_USAGE(HID_USAGE_GD, HID_USAGE_GD_SYSTEM_SLEEP)) #define SYS_SLEEP (SYSTEM_SLEEP) /* System Wake Up */ -#define SYSTEM_WAKE_UP (HID_USAGE(HID_USAGE_GD, HID_USAGE_GD_SYSTEM_WAKE_UP)) +#define SYSTEM_WAKE_UP (HID_EXT_USAGE(HID_USAGE_GD, HID_USAGE_GD_SYSTEM_WAKE_UP)) #define SYS_WAKE (SYSTEM_WAKE_UP) /* Keyboard a and A */ -#define A (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_A)) +#define A (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_A)) /* Keyboard b and B */ -#define B (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_B)) +#define B (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_B)) /* Keyboard c and C */ -#define C (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_C)) +#define C (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_C)) /* Keyboard d and D */ -#define D (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_D)) +#define D (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_D)) /* Keyboard e and E */ -#define E (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_E)) +#define E (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_E)) /* Keyboard f and F */ -#define F (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F)) +#define F (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F)) /* Keyboard g and G */ -#define G (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_G)) +#define G (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_G)) /* Keyboard h and H */ -#define H (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_H)) +#define H (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_H)) /* Keyboard i and I */ -#define I (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_I)) +#define I (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_I)) /* Keyboard j and J */ -#define J (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_J)) +#define J (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_J)) /* Keyboard k and K */ -#define K (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_K)) +#define K (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_K)) /* Keyboard l and L */ -#define L (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_L)) +#define L (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_L)) /* Keyboard m and M */ -#define M (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_M)) +#define M (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_M)) /* Keyboard n and N */ -#define N (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_N)) +#define N (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_N)) /* Keyboard o and O */ -#define O (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_O)) +#define O (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_O)) /* Keyboard p and P */ -#define P (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_P)) +#define P (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_P)) /* Keyboard q and Q */ -#define Q (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_Q)) +#define Q (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_Q)) /* Keyboard r and R */ -#define R (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_R)) +#define R (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_R)) /* Keyboard s and S */ -#define S (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_S)) +#define S (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_S)) /* Keyboard t and T */ -#define T (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_T)) +#define T (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_T)) /* Keyboard u and U */ -#define U (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_U)) +#define U (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_U)) /* Keyboard v and V */ -#define V (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_V)) +#define V (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_V)) /* Keyboard w and W */ -#define W (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_W)) +#define W (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_W)) /* Keyboard x and X */ -#define X (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_X)) +#define X (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_X)) /* Keyboard y and Y */ -#define Y (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_Y)) +#define Y (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_Y)) /* Keyboard z and Z */ -#define Z (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_Z)) +#define Z (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_Z)) /* Keyboard 1 and ! (Exclamation) */ -#define NUMBER_1 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_1_AND_EXCLAMATION)) +#define NUMBER_1 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_1_AND_EXCLAMATION)) #define N1 (NUMBER_1) #define NUM_1 (NUMBER_1) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard ! (Exclamation) */ -#define EXCLAMATION (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_1_AND_EXCLAMATION))) +#define EXCLAMATION (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_1_AND_EXCLAMATION))) #define EXCL (EXCLAMATION) #define BANG (EXCLAMATION) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard 2 and @ (At sign) */ -#define NUMBER_2 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_2_AND_AT)) +#define NUMBER_2 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_2_AND_AT)) #define N2 (NUMBER_2) #define NUM_2 (NUMBER_2) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard @ (At sign) */ -#define AT_SIGN (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_2_AND_AT))) +#define AT_SIGN (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_2_AND_AT))) #define AT (AT_SIGN) #define ATSN (AT_SIGN) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard 3 and # (Hash/Number) */ -#define NUMBER_3 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_3_AND_HASH)) +#define NUMBER_3 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_3_AND_HASH)) #define N3 (NUMBER_3) #define NUM_3 (NUMBER_3) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard # (Hash/Number) */ -#define HASH (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_3_AND_HASH))) +#define HASH (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_3_AND_HASH))) #define POUND (HASH) /* Keyboard 4 and $ (Dollar) */ -#define NUMBER_4 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_4_AND_DOLLAR)) +#define NUMBER_4 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_4_AND_DOLLAR)) #define N4 (NUMBER_4) #define NUM_4 (NUMBER_4) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard $ (Dollar) */ -#define DOLLAR (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_4_AND_DOLLAR))) +#define DOLLAR (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_4_AND_DOLLAR))) #define DLLR (DOLLAR) /* Keyboard 5 and % (Percent) */ -#define NUMBER_5 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_5_AND_PERCENT)) +#define NUMBER_5 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_5_AND_PERCENT)) #define N5 (NUMBER_5) #define NUM_5 (NUMBER_5) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard % (Percent) */ -#define PERCENT (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_5_AND_PERCENT))) +#define PERCENT (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_5_AND_PERCENT))) #define PRCNT (PERCENT) #define PRCT (PERCENT) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard 6 and ^ (Caret) */ -#define NUMBER_6 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_6_AND_CARET)) +#define NUMBER_6 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_6_AND_CARET)) #define N6 (NUMBER_6) #define NUM_6 (NUMBER_6) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard ^ (Caret) */ -#define CARET (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_6_AND_CARET))) +#define CARET (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_6_AND_CARET))) #define CRRT (CARET) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard 7 and & (Ampersand) */ -#define NUMBER_7 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_7_AND_AMPERSAND)) +#define NUMBER_7 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_7_AND_AMPERSAND)) #define N7 (NUMBER_7) #define NUM_7 (NUMBER_7) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard & (Ampersand) */ -#define AMPERSAND (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_7_AND_AMPERSAND))) +#define AMPERSAND (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_7_AND_AMPERSAND))) #define AMPS (AMPERSAND) /* Keyboard 8 and * (Asterisk) */ -#define NUMBER_8 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_8_AND_ASTERISK)) +#define NUMBER_8 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_8_AND_ASTERISK)) #define N8 (NUMBER_8) #define NUM_8 (NUMBER_8) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard * (Asterisk) */ -#define ASTERISK (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_8_AND_ASTERISK))) +#define ASTERISK (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_8_AND_ASTERISK))) #define ASTRK (ASTERISK) #define STAR (ASTERISK) /* Keyboard 9 and ( (Left Parenthesis) */ -#define NUMBER_9 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_9_AND_LEFT_PARENTHESIS)) +#define NUMBER_9 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_9_AND_LEFT_PARENTHESIS)) #define N9 (NUMBER_9) #define NUM_9 (NUMBER_9) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard ( (Left Parenthesis) */ #define LEFT_PARENTHESIS \ - (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_9_AND_LEFT_PARENTHESIS))) + (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_9_AND_LEFT_PARENTHESIS))) #define LPAR (LEFT_PARENTHESIS) #define LPRN (LEFT_PARENTHESIS) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard 0 and ) (Right Parenthesis) */ -#define NUMBER_0 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_0_AND_RIGHT_PARENTHESIS)) +#define NUMBER_0 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_0_AND_RIGHT_PARENTHESIS)) #define N0 (NUMBER_0) #define NUM_0 (NUMBER_0) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard ) (Right Parenthesis) */ #define RIGHT_PARENTHESIS \ - (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_0_AND_RIGHT_PARENTHESIS))) + (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_0_AND_RIGHT_PARENTHESIS))) #define RPAR (RIGHT_PARENTHESIS) #define RPRN (RIGHT_PARENTHESIS) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Return (Enter) */ -#define RETURN (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RETURN_ENTER)) +#define RETURN (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RETURN_ENTER)) #define ENTER (RETURN) #define RET (RETURN) /* Keyboard Escape */ -#define ESCAPE (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_ESCAPE)) +#define ESCAPE (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_ESCAPE)) #define ESC (ESCAPE) /* Keyboard Backspace */ -#define BACKSPACE (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_DELETE_BACKSPACE)) +#define BACKSPACE (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_DELETE_BACKSPACE)) #define BSPC (BACKSPACE) #define BKSP (BACKSPACE) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Tab */ -#define TAB (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_TAB)) +#define TAB (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_TAB)) /* Keyboard Space */ -#define SPACE (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SPACEBAR)) +#define SPACE (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SPACEBAR)) #define SPC (SPACE) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard - and _ (Minus and Underscore) */ -#define MINUS (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_MINUS_AND_UNDERSCORE)) +#define MINUS (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_MINUS_AND_UNDERSCORE)) /* Keyboard _ (Underscore) */ -#define UNDERSCORE (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_MINUS_AND_UNDERSCORE))) +#define UNDERSCORE (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_MINUS_AND_UNDERSCORE))) #define UNDER (UNDERSCORE) /* Keyboard = and + (Equal and Plus) */ -#define EQUAL (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_EQUAL_AND_PLUS)) +#define EQUAL (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_EQUAL_AND_PLUS)) #define EQL (EQUAL) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard + (Plus) */ -#define PLUS (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_EQUAL_AND_PLUS))) +#define PLUS (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_EQUAL_AND_PLUS))) /* Keyboard [ and { (Left Bracket and Left Brace) */ -#define LEFT_BRACKET (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LEFT_BRACKET_AND_LEFT_BRACE)) +#define LEFT_BRACKET \ + (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LEFT_BRACKET_AND_LEFT_BRACE)) #define LBKT (LEFT_BRACKET) /* Keyboard { (Left Brace) */ #define LEFT_BRACE \ - (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LEFT_BRACKET_AND_LEFT_BRACE))) + (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LEFT_BRACKET_AND_LEFT_BRACE))) #define LBRC (LEFT_BRACE) #define LCUR (LEFT_BRACE) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard ] and } (Right Bracket and Right Brace) */ #define RIGHT_BRACKET \ - (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RIGHT_BRACKET_AND_RIGHT_BRACE)) + (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RIGHT_BRACKET_AND_RIGHT_BRACE)) #define RBKT (RIGHT_BRACKET) /* Keyboard } (Right Brace) */ #define RIGHT_BRACE \ - (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RIGHT_BRACKET_AND_RIGHT_BRACE))) + (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RIGHT_BRACKET_AND_RIGHT_BRACE))) #define RBRC (RIGHT_BRACE) #define RCUR (RIGHT_BRACE) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard \ and | (Backslash and Pipe) */ -#define BACKSLASH (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_BACKSLASH_AND_PIPE)) +#define BACKSLASH (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_BACKSLASH_AND_PIPE)) #define BSLH (BACKSLASH) /* Keyboard | (Pipe) */ -#define PIPE (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_BACKSLASH_AND_PIPE))) +#define PIPE (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_BACKSLASH_AND_PIPE))) /* Keyboard Non-US # and ~ (Non-US Hash/Number and Tilde) */ -#define NON_US_HASH (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_NON_US_HASH_AND_TILDE)) +#define NON_US_HASH (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_NON_US_HASH_AND_TILDE)) /* Keyboard ~ (Tilde) */ -#define TILDE2 (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_NON_US_HASH_AND_TILDE))) +#define TILDE2 (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_NON_US_HASH_AND_TILDE))) /* Keyboard ; and : (Semicolon and Colon) */ -#define SEMICOLON (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SEMICOLON_AND_COLON)) +#define SEMICOLON (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SEMICOLON_AND_COLON)) #define SEMI (SEMICOLON) #define SCLN (SEMICOLON) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard : (Colon) */ -#define COLON (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SEMICOLON_AND_COLON))) +#define COLON (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SEMICOLON_AND_COLON))) #define COLN (COLON) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard ' and " (Apostrophe and Quote) */ -#define SINGLE_QUOTE (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_APOSTROPHE_AND_QUOTE)) +#define SINGLE_QUOTE (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_APOSTROPHE_AND_QUOTE)) #define SQT (SINGLE_QUOTE) #define APOSTROPHE (SINGLE_QUOTE) #define APOS (SINGLE_QUOTE) #define QUOT (SINGLE_QUOTE) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard " (Quote) */ -#define DOUBLE_QUOTES (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_APOSTROPHE_AND_QUOTE))) +#define DOUBLE_QUOTES \ + (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_APOSTROPHE_AND_QUOTE))) #define DQT (DOUBLE_QUOTES) /* Keyboard ` and ~ (Grave Accent and Tilde) */ -#define GRAVE (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_GRAVE_ACCENT_AND_TILDE)) +#define GRAVE (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_GRAVE_ACCENT_AND_TILDE)) #define GRAV (GRAVE) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard ~ (Tilde) */ -#define TILDE (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_GRAVE_ACCENT_AND_TILDE))) +#define TILDE (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_GRAVE_ACCENT_AND_TILDE))) #define TILD (TILDE) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard , and < (Comma and Less Than) */ -#define COMMA (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_COMMA_AND_LESS_THAN)) +#define COMMA (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_COMMA_AND_LESS_THAN)) #define CMMA (COMMA) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard < (Less Than) */ -#define LESS_THAN (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_COMMA_AND_LESS_THAN))) +#define LESS_THAN (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_COMMA_AND_LESS_THAN))) #define LT (LESS_THAN) #define LABT (LESS_THAN) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard . and > (Period and Greater Than) */ -#define PERIOD (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_PERIOD_AND_GREATER_THAN)) +#define PERIOD (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_PERIOD_AND_GREATER_THAN)) #define DOT (PERIOD) /* Keyboard > (Greater Than) */ -#define GREATER_THAN (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_PERIOD_AND_GREATER_THAN))) +#define GREATER_THAN \ + (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_PERIOD_AND_GREATER_THAN))) #define GT (GREATER_THAN) #define RABT (GREATER_THAN) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard / and ? (Forward Slash and Question) */ -#define SLASH (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SLASH_AND_QUESTION_MARK)) +#define SLASH (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SLASH_AND_QUESTION_MARK)) #define FSLH (SLASH) /* Keyboard ? (Question) */ -#define QUESTION (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SLASH_AND_QUESTION_MARK))) +#define QUESTION (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SLASH_AND_QUESTION_MARK))) #define QMARK (QUESTION) /* Keyboard Caps Lock */ -#define CAPSLOCK (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_CAPS_LOCK)) +#define CAPSLOCK (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_CAPS_LOCK)) #define CAPS (CAPSLOCK) #define CLCK (CAPSLOCK) /* Keyboard F1 */ -#define F1 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F1)) +#define F1 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F1)) /* Keyboard F2 */ -#define F2 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F2)) +#define F2 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F2)) /* Keyboard F3 */ -#define F3 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F3)) +#define F3 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F3)) /* Keyboard F4 */ -#define F4 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F4)) +#define F4 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F4)) /* Keyboard F5 */ -#define F5 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F5)) +#define F5 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F5)) /* Keyboard F6 */ -#define F6 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F6)) +#define F6 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F6)) /* Keyboard F7 */ -#define F7 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F7)) +#define F7 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F7)) /* Keyboard F8 */ -#define F8 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F8)) +#define F8 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F8)) /* Keyboard F9 */ -#define F9 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F9)) +#define F9 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F9)) /* Keyboard F10 */ -#define F10 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F10)) +#define F10 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F10)) /* Keyboard F11 */ -#define F11 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F11)) +#define F11 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F11)) /* Keyboard F12 */ -#define F12 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F12)) +#define F12 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F12)) /* Keyboard Print Screen */ -#define PRINTSCREEN (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_PRINTSCREEN)) +#define PRINTSCREEN (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_PRINTSCREEN)) #define PSCRN (PRINTSCREEN) #define PRSC (PRINTSCREEN) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Scroll Lock */ -#define SCROLLLOCK (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SCROLL_LOCK)) +#define SCROLLLOCK (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SCROLL_LOCK)) #define SLCK (SCROLLLOCK) #define SCLK (SCROLLLOCK) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Pause/Break */ -#define PAUSE_BREAK (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_PAUSE)) +#define PAUSE_BREAK (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_PAUSE)) #define PAUS (PAUSE_BREAK) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Insert */ -#define INSERT (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INSERT)) +#define INSERT (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INSERT)) #define INS (INSERT) /* Keyboard Home */ -#define HOME (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_HOME)) +#define HOME (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_HOME)) /* Keyboard Page Up */ -#define PAGE_UP (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_PAGEUP)) +#define PAGE_UP (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_PAGEUP)) #define PG_UP (PAGE_UP) #define PGUP (PAGE_UP) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Delete */ -#define DELETE (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_DELETE_FORWARD)) +#define DELETE (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_DELETE_FORWARD)) #define DEL (DELETE) /* Keyboard End */ -#define END (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_END)) +#define END (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_END)) /* Keyboard Page Down */ -#define PAGE_DOWN (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_PAGEDOWN)) +#define PAGE_DOWN (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_PAGEDOWN)) #define PG_DN (PAGE_DOWN) #define PGDN (PAGE_DOWN) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Right Arrow */ -#define RIGHT_ARROW (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RIGHTARROW)) +#define RIGHT_ARROW (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RIGHTARROW)) #define RIGHT (RIGHT_ARROW) #define RARW (RIGHT_ARROW) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Left Arrow */ -#define LEFT_ARROW (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LEFTARROW)) +#define LEFT_ARROW (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LEFTARROW)) #define LEFT (LEFT_ARROW) #define LARW (LEFT_ARROW) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Down Arrow */ -#define DOWN_ARROW (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_DOWNARROW)) +#define DOWN_ARROW (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_DOWNARROW)) #define DOWN (DOWN_ARROW) #define DARW (DOWN_ARROW) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Up Arrow */ -#define UP_ARROW (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_UPARROW)) +#define UP_ARROW (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_UPARROW)) #define UP (UP_ARROW) #define UARW (UP_ARROW) // WARNING: DEPRECATED (DO NOT USE) /* Keypad Numlock and Clear */ -#define KP_NUMLOCK (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_NUM_LOCK_AND_CLEAR)) +#define KP_NUMLOCK (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_NUM_LOCK_AND_CLEAR)) #define KP_NUM (KP_NUMLOCK) #define KP_NLCK (KP_NUMLOCK) /* Keypad Clear */ -#define CLEAR2 (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_NUM_LOCK_AND_CLEAR))) +#define CLEAR2 (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_NUM_LOCK_AND_CLEAR))) /* Keypad / (Slash/Divide) */ -#define KP_DIVIDE (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_SLASH)) +#define KP_DIVIDE (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_SLASH)) #define KP_SLASH (KP_DIVIDE) #define KDIV (KP_DIVIDE) // WARNING: DEPRECATED (DO NOT USE) /* Keypad * (Multiply) */ -#define KP_MULTIPLY (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_ASTERISK)) +#define KP_MULTIPLY (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_ASTERISK)) #define KP_ASTERISK (KP_MULTIPLY) #define KMLT (KP_MULTIPLY) // WARNING: DEPRECATED (DO NOT USE) /* Keypad - (Minus) */ -#define KP_MINUS (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_MINUS)) +#define KP_MINUS (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_MINUS)) #define KP_SUBTRACT (KP_MINUS) #define KMIN (KP_MINUS) // WARNING: DEPRECATED (DO NOT USE) /* Keypad + (Plus) */ -#define KP_PLUS (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_PLUS)) +#define KP_PLUS (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_PLUS)) #define KPLS (KP_PLUS) // WARNING: DEPRECATED (DO NOT USE) /* Keypad Enter */ -#define KP_ENTER (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_ENTER)) +#define KP_ENTER (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_ENTER)) /* Keypad 1 */ -#define KP_NUMBER_1 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_1_AND_END)) +#define KP_NUMBER_1 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_1_AND_END)) #define KP_N1 (KP_NUMBER_1) /* Keypad 2 */ -#define KP_NUMBER_2 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_2_AND_DOWN_ARROW)) +#define KP_NUMBER_2 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_2_AND_DOWN_ARROW)) #define KP_N2 (KP_NUMBER_2) /* Keypad 3 */ -#define KP_NUMBER_3 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_3_AND_PAGEDN)) +#define KP_NUMBER_3 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_3_AND_PAGEDN)) #define KP_N3 (KP_NUMBER_3) /* Keypad 4 */ -#define KP_NUMBER_4 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_4_AND_LEFT_ARROW)) +#define KP_NUMBER_4 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_4_AND_LEFT_ARROW)) #define KP_N4 (KP_NUMBER_4) /* Keypad 5 */ -#define KP_NUMBER_5 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_5)) +#define KP_NUMBER_5 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_5)) #define KP_N5 (KP_NUMBER_5) /* Keypad 6 */ -#define KP_NUMBER_6 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_6_AND_RIGHT_ARROW)) +#define KP_NUMBER_6 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_6_AND_RIGHT_ARROW)) #define KP_N6 (KP_NUMBER_6) /* Keypad 7 */ -#define KP_NUMBER_7 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_7_AND_HOME)) +#define KP_NUMBER_7 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_7_AND_HOME)) #define KP_N7 (KP_NUMBER_7) /* Keypad 8 */ -#define KP_NUMBER_8 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_8_AND_UP_ARROW)) +#define KP_NUMBER_8 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_8_AND_UP_ARROW)) #define KP_N8 (KP_NUMBER_8) /* Keypad 9 */ -#define KP_NUMBER_9 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_9_AND_PAGEUP)) +#define KP_NUMBER_9 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_9_AND_PAGEUP)) #define KP_N9 (KP_NUMBER_9) /* Keypad 0 */ -#define KP_NUMBER_0 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_0_AND_INSERT)) +#define KP_NUMBER_0 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_0_AND_INSERT)) #define KP_N0 (KP_NUMBER_0) /* Keypad . (Dot) */ -#define KP_DOT (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_PERIOD_AND_DELETE)) +#define KP_DOT (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_PERIOD_AND_DELETE)) /* Keyboard Non-US \ and | (Non-us Backslash and Pipe) */ #define NON_US_BACKSLASH \ - (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_NON_US_BACKSLASH_AND_PIPE)) + (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_NON_US_BACKSLASH_AND_PIPE)) #define NON_US_BSLH (NON_US_BACKSLASH) /* Keyboard Pipe */ -#define PIPE2 (LS(HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_NON_US_BACKSLASH_AND_PIPE))) +#define PIPE2 (LS(HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_NON_US_BACKSLASH_AND_PIPE))) /* Keyboard Application (Context Menu) */ -#define K_APPLICATION (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_APPLICATION)) +#define K_APPLICATION (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_APPLICATION)) #define K_APP (K_APPLICATION) #define K_CONTEXT_MENU (K_APPLICATION) #define K_CMENU (K_APPLICATION) #define GUI (K_APPLICATION) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Power */ -#define K_POWER (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_POWER)) +#define K_POWER (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_POWER)) #define K_PWR (K_POWER) /* Keypad = (Equal) */ -#define KP_EQUAL (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_EQUAL)) +#define KP_EQUAL (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_EQUAL)) /* Keyboard F13 */ -#define F13 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F13)) +#define F13 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F13)) /* Keyboard F14 */ -#define F14 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F14)) +#define F14 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F14)) /* Keyboard F15 */ -#define F15 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F15)) +#define F15 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F15)) /* Keyboard F16 */ -#define F16 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F16)) +#define F16 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F16)) /* Keyboard F17 */ -#define F17 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F17)) +#define F17 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F17)) /* Keyboard F18 */ -#define F18 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F18)) +#define F18 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F18)) /* Keyboard F19 */ -#define F19 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F19)) +#define F19 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F19)) /* Keyboard F20 */ -#define F20 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F20)) +#define F20 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F20)) /* Keyboard F21 */ -#define F21 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F21)) +#define F21 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F21)) /* Keyboard F22 */ -#define F22 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F22)) +#define F22 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F22)) /* Keyboard F23 */ -#define F23 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F23)) +#define F23 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F23)) /* Keyboard F24 */ -#define F24 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F24)) +#define F24 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_F24)) /* Keyboard Execute */ -#define K_EXECUTE (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_EXECUTE)) +#define K_EXECUTE (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_EXECUTE)) #define K_EXEC (K_EXECUTE) /* Keyboard Help */ -#define K_HELP (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_HELP)) +#define K_HELP (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_HELP)) /* Keyboard Menu */ -#define K_MENU (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_MENU)) +#define K_MENU (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_MENU)) /* Keyboard Select */ -#define K_SELECT (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SELECT)) +#define K_SELECT (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SELECT)) /* Keyboard Stop */ -#define K_STOP (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_STOP)) +#define K_STOP (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_STOP)) /* Keyboard Again */ -#define K_AGAIN (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_AGAIN)) +#define K_AGAIN (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_AGAIN)) #define K_REDO (K_AGAIN) /* Keyboard Undo */ -#define K_UNDO (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_UNDO)) +#define K_UNDO (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_UNDO)) #define UNDO (K_UNDO) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Cut */ -#define K_CUT (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_CUT)) +#define K_CUT (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_CUT)) #define CUT (K_CUT) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Copy */ -#define K_COPY (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_COPY)) +#define K_COPY (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_COPY)) #define COPY (K_COPY) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Paste */ -#define K_PASTE (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_PASTE)) +#define K_PASTE (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_PASTE)) #define PSTE (K_PASTE) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Find */ -#define K_FIND (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_FIND)) +#define K_FIND (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_FIND)) /* Keyboard Mute */ -#define K_MUTE (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_MUTE)) +#define K_MUTE (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_MUTE)) /* Keyboard Volume Up */ -#define K_VOLUME_UP (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_VOLUME_UP)) +#define K_VOLUME_UP (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_VOLUME_UP)) #define K_VOL_UP (K_VOLUME_UP) #define VOLU (K_VOLUME_UP) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Volume Down */ -#define K_VOLUME_DOWN (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_VOLUME_DOWN)) +#define K_VOLUME_DOWN (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_VOLUME_DOWN)) #define K_VOL_DN (K_VOLUME_DOWN) #define VOLD (K_VOLUME_DOWN) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Locking Caps Lock */ -#define LOCKING_CAPS (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LOCKING_CAPS_LOCK)) +#define LOCKING_CAPS (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LOCKING_CAPS_LOCK)) #define LCAPS (LOCKING_CAPS) /* Keyboard Locking Num Lock */ -#define LOCKING_NUM (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LOCKING_NUM_LOCK)) +#define LOCKING_NUM (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LOCKING_NUM_LOCK)) #define LNLCK (LOCKING_NUM) /* Keyboard Locking Scroll Lock */ -#define LOCKING_SCROLL (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LOCKING_SCROLL_LOCK)) +#define LOCKING_SCROLL (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LOCKING_SCROLL_LOCK)) #define LSLCK (LOCKING_SCROLL) /* Keypad , (Comma) */ -#define KP_COMMA (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_COMMA)) +#define KP_COMMA (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_COMMA)) /* Keypad = (Equal) AS/400 */ -#define KP_EQUAL_AS400 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_EQUAL_SIGN)) +#define KP_EQUAL_AS400 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_EQUAL_SIGN)) /* Keyboard International 1 */ -#define INTERNATIONAL_1 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL1)) +#define INTERNATIONAL_1 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL1)) #define INT1 (INTERNATIONAL_1) #define INT_RO (INTERNATIONAL_1) /* Keyboard International 2 */ -#define INTERNATIONAL_2 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL2)) +#define INTERNATIONAL_2 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL2)) #define INT2 (INTERNATIONAL_2) #define INT_KATAKANAHIRAGANA (INTERNATIONAL_2) #define INT_KANA (INTERNATIONAL_2) /* Keyboard International 3 */ -#define INTERNATIONAL_3 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL3)) +#define INTERNATIONAL_3 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL3)) #define INT3 (INTERNATIONAL_3) #define INT_YEN (INTERNATIONAL_3) /* Keyboard International 4 */ -#define INTERNATIONAL_4 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL4)) +#define INTERNATIONAL_4 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL4)) #define INT4 (INTERNATIONAL_4) #define INT_HENKAN (INTERNATIONAL_4) /* Keyboard International 5 */ -#define INTERNATIONAL_5 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL5)) +#define INTERNATIONAL_5 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL5)) #define INT5 (INTERNATIONAL_5) #define INT_MUHENKAN (INTERNATIONAL_5) /* Keyboard International 6 */ -#define INTERNATIONAL_6 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL6)) +#define INTERNATIONAL_6 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL6)) #define INT6 (INTERNATIONAL_6) #define INT_KPJPCOMMA (INTERNATIONAL_6) /* Keyboard International 7 */ -#define INTERNATIONAL_7 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL7)) +#define INTERNATIONAL_7 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL7)) #define INT7 (INTERNATIONAL_7) /* Keyboard International 8 */ -#define INTERNATIONAL_8 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL8)) +#define INTERNATIONAL_8 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL8)) #define INT8 (INTERNATIONAL_8) /* Keyboard International 9 */ -#define INTERNATIONAL_9 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL9)) +#define INTERNATIONAL_9 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_INTERNATIONAL9)) #define INT9 (INTERNATIONAL_9) /* Keyboard Language 1 */ -#define LANGUAGE_1 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG1)) +#define LANGUAGE_1 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG1)) #define LANG1 (LANGUAGE_1) #define LANG_HANGEUL (LANGUAGE_1) /* Keyboard Language 2 */ -#define LANGUAGE_2 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG2)) +#define LANGUAGE_2 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG2)) #define LANG2 (LANGUAGE_2) #define LANG_HANJA (LANGUAGE_2) /* Keyboard Language 3 */ -#define LANGUAGE_3 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG3)) +#define LANGUAGE_3 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG3)) #define LANG3 (LANGUAGE_3) #define LANG_KATAKANA (LANGUAGE_3) /* Keyboard Language 4 */ -#define LANGUAGE_4 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG4)) +#define LANGUAGE_4 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG4)) #define LANG4 (LANGUAGE_4) #define LANG_HIRAGANA (LANGUAGE_4) /* Keyboard Language 5 */ -#define LANGUAGE_5 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG5)) +#define LANGUAGE_5 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG5)) #define LANG5 (LANGUAGE_5) #define LANG_ZENKAKUHANKAKU (LANGUAGE_5) /* Keyboard Language 6 */ -#define LANGUAGE_6 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG6)) +#define LANGUAGE_6 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG6)) #define LANG6 (LANGUAGE_6) /* Keyboard Language 7 */ -#define LANGUAGE_7 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG7)) +#define LANGUAGE_7 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG7)) #define LANG7 (LANGUAGE_7) /* Keyboard Language 8 */ -#define LANGUAGE_8 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG8)) +#define LANGUAGE_8 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG8)) #define LANG8 (LANGUAGE_8) /* Keyboard Language 9 */ -#define LANGUAGE_9 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG9)) +#define LANGUAGE_9 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LANG9)) #define LANG9 (LANGUAGE_9) /* Keyboard Alternate Erase */ -#define ALT_ERASE (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_ALTERNATE_ERASE)) +#define ALT_ERASE (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_ALTERNATE_ERASE)) /* Keyboard SysReq/Attention */ -#define SYSREQ (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SYSREQ_ATTENTION)) +#define SYSREQ (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SYSREQ_ATTENTION)) #define ATTENTION (SYSREQ) /* Keyboard Cancel */ -#define K_CANCEL (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_CANCEL)) +#define K_CANCEL (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_CANCEL)) /* Keyboard Clear */ -#define CLEAR (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_CLEAR)) +#define CLEAR (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_CLEAR)) /* Keyboard Prior */ -#define PRIOR (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_PRIOR)) +#define PRIOR (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_PRIOR)) /* Keyboard Return */ -#define RETURN2 (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RETURN)) +#define RETURN2 (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RETURN)) #define RET2 (RETURN2) /* Keyboard Separator */ -#define SEPARATOR (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SEPARATOR)) +#define SEPARATOR (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_SEPARATOR)) /* Keyboard Out */ -#define OUT (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_OUT)) +#define OUT (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_OUT)) /* Keyboard Oper */ -#define OPER (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_OPER)) +#define OPER (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_OPER)) /* Keyboard Clear/Again */ -#define CLEAR_AGAIN (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_CLEAR_AGAIN)) +#define CLEAR_AGAIN (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_CLEAR_AGAIN)) /* Keyboard CrSel/Props */ -#define CRSEL (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_CRSEL_PROPS)) +#define CRSEL (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_CRSEL_PROPS)) /* Keyboard ExSel */ -#define EXSEL (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_EXSEL)) +#define EXSEL (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_EXSEL)) /* Keyboard Currency Unit */ #define CURU \ - (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_CURRENCY_UNIT)) // WARNING: DEPRECATED (DO NOT USE) + (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_CURRENCY_UNIT)) // WARNING: DEPRECATED (DO NOT USE) /* Keypad ( (Left Parenthesis) */ -#define KP_LEFT_PARENTHESIS (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_LEFT_PARENTHESIS)) +#define KP_LEFT_PARENTHESIS (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_LEFT_PARENTHESIS)) #define KP_LPAR (KP_LEFT_PARENTHESIS) /* Keypad ) (Right Parenthesis) */ -#define KP_RIGHT_PARENTHESIS (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_RIGHT_PARENTHESIS)) +#define KP_RIGHT_PARENTHESIS (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_RIGHT_PARENTHESIS)) #define KP_RPAR (KP_RIGHT_PARENTHESIS) /* Keypad Space */ #define KSPC \ - (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_SPACE)) // WARNING: DEPRECATED (DO NOT USE) + (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_SPACE)) // WARNING: DEPRECATED (DO NOT USE) /* Keypad Clear */ -#define KP_CLEAR (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_CLEAR)) +#define KP_CLEAR (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYPAD_CLEAR)) /* Keyboard Left Control */ -#define LEFT_CONTROL (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LEFTCONTROL)) +#define LEFT_CONTROL (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LEFTCONTROL)) #define LCTRL (LEFT_CONTROL) #define LCTL (LEFT_CONTROL) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Left Shift */ -#define LEFT_SHIFT (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LEFTSHIFT)) +#define LEFT_SHIFT (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LEFTSHIFT)) #define LSHFT (LEFT_SHIFT) #define LSFT (LEFT_SHIFT) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Left Alt */ -#define LEFT_ALT (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LEFTALT)) +#define LEFT_ALT (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LEFTALT)) #define LALT (LEFT_ALT) /* Keyboard Left GUI (Windows / Command / Meta) */ -#define LEFT_GUI (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LEFT_GUI)) +#define LEFT_GUI (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_LEFT_GUI)) #define LGUI (LEFT_GUI) #define LEFT_WIN (LEFT_GUI) #define LWIN (LEFT_GUI) @@ -786,21 +789,21 @@ #define LMETA (LEFT_GUI) /* Keyboard Right Control */ -#define RIGHT_CONTROL (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RIGHTCONTROL)) +#define RIGHT_CONTROL (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RIGHTCONTROL)) #define RCTRL (RIGHT_CONTROL) #define RCTL (RIGHT_CONTROL) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Right Shift */ -#define RIGHT_SHIFT (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RIGHTSHIFT)) +#define RIGHT_SHIFT (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RIGHTSHIFT)) #define RSHFT (RIGHT_SHIFT) #define RSFT (RIGHT_SHIFT) // WARNING: DEPRECATED (DO NOT USE) /* Keyboard Right Alt */ -#define RIGHT_ALT (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RIGHTALT)) +#define RIGHT_ALT (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RIGHTALT)) #define RALT (RIGHT_ALT) /* Keyboard Right GUI (Windows / Command / Meta) */ -#define RIGHT_GUI (HID_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RIGHT_GUI)) +#define RIGHT_GUI (HID_EXT_USAGE(HID_USAGE_KEY, HID_USAGE_KEY_KEYBOARD_RIGHT_GUI)) #define RGUI (RIGHT_GUI) #define RIGHT_WIN (RIGHT_GUI) #define RWIN (RIGHT_GUI) @@ -810,611 +813,621 @@ #define RMETA (RIGHT_GUI) /* Keyboard Play/Pause */ -#define K_PLAY_PAUSE (HID_USAGE(HID_USAGE_KEY, 0xE8)) +#define K_PLAY_PAUSE (HID_EXT_USAGE(HID_USAGE_KEY, 0xE8)) #define K_PP (K_PLAY_PAUSE) /* Keyboard Stop */ -#define K_STOP2 (HID_USAGE(HID_USAGE_KEY, 0xE9)) +#define K_STOP2 (HID_EXT_USAGE(HID_USAGE_KEY, 0xE9)) /* Keyboard Previous */ -#define K_PREVIOUS (HID_USAGE(HID_USAGE_KEY, 0xEA)) +#define K_PREVIOUS (HID_EXT_USAGE(HID_USAGE_KEY, 0xEA)) #define K_PREV (K_PREVIOUS) /* Keyboard Next */ -#define K_NEXT (HID_USAGE(HID_USAGE_KEY, 0xEB)) +#define K_NEXT (HID_EXT_USAGE(HID_USAGE_KEY, 0xEB)) /* Keyboard Eject */ -#define K_EJECT (HID_USAGE(HID_USAGE_KEY, 0xEC)) +#define K_EJECT (HID_EXT_USAGE(HID_USAGE_KEY, 0xEC)) /* Keyboard Volume Up */ -#define K_VOLUME_UP2 (HID_USAGE(HID_USAGE_KEY, 0xED)) +#define K_VOLUME_UP2 (HID_EXT_USAGE(HID_USAGE_KEY, 0xED)) #define K_VOL_UP2 (K_VOLUME_UP2) /* Keyboard Volume Down */ -#define K_VOLUME_DOWN2 (HID_USAGE(HID_USAGE_KEY, 0xEE)) +#define K_VOLUME_DOWN2 (HID_EXT_USAGE(HID_USAGE_KEY, 0xEE)) #define K_VOL_DN2 (K_VOLUME_DOWN2) /* Keyboard Mute */ -#define K_MUTE2 (HID_USAGE(HID_USAGE_KEY, 0xEF)) +#define K_MUTE2 (HID_EXT_USAGE(HID_USAGE_KEY, 0xEF)) /* Keyboard WWW */ -#define K_WWW (HID_USAGE(HID_USAGE_KEY, 0xF0)) +#define K_WWW (HID_EXT_USAGE(HID_USAGE_KEY, 0xF0)) /* Keyboard Back */ -#define K_BACK (HID_USAGE(HID_USAGE_KEY, 0xF1)) +#define K_BACK (HID_EXT_USAGE(HID_USAGE_KEY, 0xF1)) /* Keyboard Forward */ -#define K_FORWARD (HID_USAGE(HID_USAGE_KEY, 0xF2)) +#define K_FORWARD (HID_EXT_USAGE(HID_USAGE_KEY, 0xF2)) /* Keyboard Stop */ -#define K_STOP3 (HID_USAGE(HID_USAGE_KEY, 0xF3)) +#define K_STOP3 (HID_EXT_USAGE(HID_USAGE_KEY, 0xF3)) /* Keyboard Find */ -#define K_FIND2 (HID_USAGE(HID_USAGE_KEY, 0xF4)) +#define K_FIND2 (HID_EXT_USAGE(HID_USAGE_KEY, 0xF4)) /* Keyboard Scroll Up */ -#define K_SCROLL_UP (HID_USAGE(HID_USAGE_KEY, 0xF5)) +#define K_SCROLL_UP (HID_EXT_USAGE(HID_USAGE_KEY, 0xF5)) /* Keyboard Scroll Down */ -#define K_SCROLL_DOWN (HID_USAGE(HID_USAGE_KEY, 0xF6)) +#define K_SCROLL_DOWN (HID_EXT_USAGE(HID_USAGE_KEY, 0xF6)) /* Keyboard Edit */ -#define K_EDIT (HID_USAGE(HID_USAGE_KEY, 0xF7)) +#define K_EDIT (HID_EXT_USAGE(HID_USAGE_KEY, 0xF7)) /* Keyboard Sleep */ -#define K_SLEEP (HID_USAGE(HID_USAGE_KEY, 0xF8)) +#define K_SLEEP (HID_EXT_USAGE(HID_USAGE_KEY, 0xF8)) /* Keyboard Lock */ -#define K_LOCK (HID_USAGE(HID_USAGE_KEY, 0xF9)) +#define K_LOCK (HID_EXT_USAGE(HID_USAGE_KEY, 0xF9)) #define K_SCREENSAVER (K_LOCK) #define K_COFFEE (K_LOCK) /* Keyboard Refresh */ -#define K_REFRESH (HID_USAGE(HID_USAGE_KEY, 0xFA)) +#define K_REFRESH (HID_EXT_USAGE(HID_USAGE_KEY, 0xFA)) /* Keyboard Calculator */ -#define K_CALCULATOR (HID_USAGE(HID_USAGE_KEY, 0xFB)) +#define K_CALCULATOR (HID_EXT_USAGE(HID_USAGE_KEY, 0xFB)) #define K_CALC (K_CALCULATOR) /* Consumer Power */ -#define C_POWER (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_POWER)) +#define C_POWER (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_POWER)) #define C_PWR (C_POWER) /* Consumer Reset */ -#define C_RESET (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_RESET)) +#define C_RESET (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_RESET)) /* Consumer Sleep */ -#define C_SLEEP (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_SLEEP)) +#define C_SLEEP (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_SLEEP)) /* Consumer Sleep Mode */ -#define C_SLEEP_MODE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_SLEEP_MODE)) +#define C_SLEEP_MODE (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_SLEEP_MODE)) /* Consumer Menu */ -#define C_MENU (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU)) +#define C_MENU (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU)) /* Consumer Menu Pick */ -#define C_MENU_PICK (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU_PICK)) +#define C_MENU_PICK (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU_PICK)) #define C_MENU_SELECT (C_MENU_PICK) /* Consumer Menu Up */ -#define C_MENU_UP (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU_UP)) +#define C_MENU_UP (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU_UP)) /* Consumer Menu Down */ -#define C_MENU_DOWN (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU_DOWN)) +#define C_MENU_DOWN (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU_DOWN)) /* Consumer Menu Left */ -#define C_MENU_LEFT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU_LEFT)) +#define C_MENU_LEFT (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU_LEFT)) /* Consumer Menu Right */ -#define C_MENU_RIGHT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU_RIGHT)) +#define C_MENU_RIGHT (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU_RIGHT)) /* Consumer Menu Escape */ -#define C_MENU_ESCAPE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU_ESCAPE)) +#define C_MENU_ESCAPE (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU_ESCAPE)) #define C_MENU_ESC (C_MENU_ESCAPE) /* Consumer Menu Value Increase */ -#define C_MENU_INCREASE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU_VALUE_INCREASE)) +#define C_MENU_INCREASE (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU_VALUE_INCREASE)) #define C_MENU_INC (C_MENU_INCREASE) /* Consumer Menu Value Decrease */ -#define C_MENU_DECREASE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU_VALUE_DECREASE)) +#define C_MENU_DECREASE (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MENU_VALUE_DECREASE)) #define C_MENU_DEC (C_MENU_DECREASE) /* Consumer Data On Screen */ -#define C_DATA_ON_SCREEN (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_DATA_ON_SCREEN)) +#define C_DATA_ON_SCREEN (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_DATA_ON_SCREEN)) /* Consumer Closed Caption */ -#define C_CAPTIONS (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_CLOSED_CAPTION)) +#define C_CAPTIONS (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_CLOSED_CAPTION)) #define C_SUBTITILES (C_CAPTIONS) /* Consumer Snapshot */ -#define C_SNAPSHOT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_SNAPSHOT)) +#define C_SNAPSHOT (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_SNAPSHOT)) /* Consumer Picture-in-Picture Toggle */ -#define C_PIP (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_PICTURE_IN_PICTURE_TOGGLE)) +#define C_PIP (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_PICTURE_IN_PICTURE_TOGGLE)) /* Consumer Red Menu Button */ -#define C_RED_BUTTON (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_RED_MENU_BUTTON)) +#define C_RED_BUTTON (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_RED_MENU_BUTTON)) #define C_RED (C_RED_BUTTON) /* Consumer Green Menu Button */ -#define C_GREEN_BUTTON (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_GREEN_MENU_BUTTON)) +#define C_GREEN_BUTTON (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_GREEN_MENU_BUTTON)) #define C_GREEN (C_GREEN_BUTTON) /* Consumer Blue Menu Button */ -#define C_BLUE_BUTTON (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_BLUE_MENU_BUTTON)) +#define C_BLUE_BUTTON (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_BLUE_MENU_BUTTON)) #define C_BLUE (C_BLUE_BUTTON) /* Consumer Yellow Menu Button */ -#define C_YELLOW_BUTTON (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_YELLOW_MENU_BUTTON)) +#define C_YELLOW_BUTTON (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_YELLOW_MENU_BUTTON)) #define C_YELLOW (C_YELLOW_BUTTON) /* Consumer Aspect */ -#define C_ASPECT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_ASPECT)) +#define C_ASPECT (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_ASPECT)) /* Consumer Display Brightness Increment */ #define C_BRIGHTNESS_INC \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_DISPLAY_BRIGHTNESS_INCREMENT)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_DISPLAY_BRIGHTNESS_INCREMENT)) #define C_BRI_INC (C_BRIGHTNESS_INC) #define C_BRI_UP (C_BRIGHTNESS_INC) /* Consumer Display Brightness Decrement */ #define C_BRIGHTNESS_DEC \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_DISPLAY_BRIGHTNESS_DECREMENT)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_DISPLAY_BRIGHTNESS_DECREMENT)) #define C_BRI_DEC (C_BRIGHTNESS_DEC) #define C_BRI_DN (C_BRIGHTNESS_DEC) /* Consumer Display Backlight Toggle */ #define C_BACKLIGHT_TOGGLE \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_DISPLAY_BACKLIGHT_TOGGLE)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_DISPLAY_BACKLIGHT_TOGGLE)) #define C_BKLT_TOG (C_BACKLIGHT_TOGGLE) /* Consumer Display Set Brightness to Minimum */ #define C_BRIGHTNESS_MINIMUM \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_DISPLAY_SET_BRIGHTNESS_TO_MINIMUM)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_DISPLAY_SET_BRIGHTNESS_TO_MINIMUM)) #define C_BRI_MIN (C_BRIGHTNESS_MINIMUM) /* Consumer Display Set Brightness to Maximum */ #define C_BRIGHTNESS_MAXIMUM \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_DISPLAY_SET_BRIGHTNESS_TO_MAXIMUM)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_DISPLAY_SET_BRIGHTNESS_TO_MAXIMUM)) #define C_BRI_MAX (C_BRIGHTNESS_MAXIMUM) /* Consumer Display Set Auto Brightness */ #define C_BRIGHTNESS_AUTO \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_DISPLAY_SET_AUTO_BRIGHTNESS)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_DISPLAY_SET_AUTO_BRIGHTNESS)) #define C_BRI_AUTO (C_BRIGHTNESS_AUTO) /* Consumer Mode Step */ -#define C_MEDIA_STEP (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MODE_STEP)) +#define C_MEDIA_STEP (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MODE_STEP)) #define C_MODE_STEP (C_MEDIA_STEP) /* Consumer Recall Last */ -#define C_RECALL_LAST (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_RECALL_LAST)) +#define C_RECALL_LAST (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_RECALL_LAST)) #define C_CHAN_LAST (C_RECALL_LAST) /* Consumer Media Select Computer */ -#define C_MEDIA_COMPUTER (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_COMPUTER)) +#define C_MEDIA_COMPUTER \ + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_COMPUTER)) /* Consumer Media Select TV */ -#define C_MEDIA_TV (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_TV)) +#define C_MEDIA_TV (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_TV)) /* Consumer Media Select WWW */ -#define C_MEDIA_WWW (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_WWW)) +#define C_MEDIA_WWW (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_WWW)) /* Consumer Media Select DVD */ -#define C_MEDIA_DVD (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_DVD)) +#define C_MEDIA_DVD (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_DVD)) /* Consumer Media Select Telephone */ -#define C_MEDIA_PHONE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_TELEPHONE)) +#define C_MEDIA_PHONE (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_TELEPHONE)) /* Consumer Media Select Program Guide */ -#define C_MEDIA_GUIDE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_PROGRAM_GUIDE)) +#define C_MEDIA_GUIDE \ + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_PROGRAM_GUIDE)) /* Consumer Media Select Video Phone */ #define C_MEDIA_VIDEOPHONE \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_VIDEO_PHONE)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_VIDEO_PHONE)) /* Consumer Media Select Games */ -#define C_MEDIA_GAMES (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_GAMES)) +#define C_MEDIA_GAMES (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_GAMES)) /* Consumer Media Select Messages */ -#define C_MEDIA_MESSAGES (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_MESSAGES)) +#define C_MEDIA_MESSAGES \ + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_MESSAGES)) /* Consumer Media Select CD */ -#define C_MEDIA_CD (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_CD)) +#define C_MEDIA_CD (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_CD)) /* Consumer Media Select VCR */ -#define C_MEDIA_VCR (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_VCR)) +#define C_MEDIA_VCR (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_VCR)) /* Consumer Media Select Tuner */ -#define C_MEDIA_TUNER (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_TUNER)) +#define C_MEDIA_TUNER (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_TUNER)) /* Consumer Quit */ -#define C_QUIT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_QUIT)) +#define C_QUIT (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_QUIT)) /* Consumer Help */ -#define C_HELP (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_HELP)) +#define C_HELP (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_HELP)) /* Consumer Media Select Tape */ -#define C_MEDIA_TAPE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_TAPE)) +#define C_MEDIA_TAPE (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_TAPE)) /* Consumer Media Select Cable */ -#define C_MEDIA_CABLE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_CABLE)) +#define C_MEDIA_CABLE (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_CABLE)) /* Consumer Media Select Satellite */ -#define C_MEDIA_SATELLITE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_SATELLITE)) +#define C_MEDIA_SATELLITE \ + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_SATELLITE)) /* Consumer Media Select Home */ -#define C_MEDIA_HOME (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_HOME)) +#define C_MEDIA_HOME (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MEDIA_SELECT_HOME)) /* Consumer Channel Increment */ -#define C_CHANNEL_INC (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_CHANNEL_INCREMENT)) +#define C_CHANNEL_INC (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_CHANNEL_INCREMENT)) #define C_CHAN_INC (C_CHANNEL_INC) /* Consumer Channel Decrement */ -#define C_CHANNEL_DEC (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_CHANNEL_DECREMENT)) +#define C_CHANNEL_DEC (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_CHANNEL_DECREMENT)) #define C_CHAN_DEC (C_CHANNEL_DEC) /* Consumer VCR Plus */ -#define C_MEDIA_VCR_PLUS (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_VCR_PLUS)) +#define C_MEDIA_VCR_PLUS (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_VCR_PLUS)) /* Consumer Play */ -#define C_PLAY (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_PLAY)) +#define C_PLAY (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_PLAY)) /* Consumer Pause */ -#define C_PAUSE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_PAUSE)) +#define C_PAUSE (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_PAUSE)) /* Consumer Record */ -#define C_RECORD (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_RECORD)) +#define C_RECORD (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_RECORD)) #define C_REC (C_RECORD) /* Consumer Fast Forward */ -#define C_FAST_FORWARD (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_FAST_FORWARD)) +#define C_FAST_FORWARD (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_FAST_FORWARD)) #define C_FF (C_FAST_FORWARD) /* Consumer Rewind */ -#define C_REWIND (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_REWIND)) +#define C_REWIND (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_REWIND)) #define C_RW (C_REWIND) /* Consumer Scan Next Track */ -#define C_NEXT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_SCAN_NEXT_TRACK)) +#define C_NEXT (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_SCAN_NEXT_TRACK)) #define M_NEXT (C_NEXT) // WARNING: DEPRECATED (DO NOT USE) /* Consumer Scan Previous Track */ -#define C_PREVIOUS (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_SCAN_PREVIOUS_TRACK)) +#define C_PREVIOUS (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_SCAN_PREVIOUS_TRACK)) #define C_PREV (C_PREVIOUS) #define M_PREV (C_PREVIOUS) // WARNING: DEPRECATED (DO NOT USE) /* Consumer Stop */ -#define C_STOP (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_STOP)) +#define C_STOP (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_STOP)) #define M_STOP (C_STOP) // WARNING: DEPRECATED (DO NOT USE) /* Consumer Eject */ -#define C_EJECT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_EJECT)) +#define C_EJECT (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_EJECT)) #define M_EJCT (C_EJECT) // WARNING: DEPRECATED (DO NOT USE) /* Consumer Random Play */ -#define C_RANDOM_PLAY (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_RANDOM_PLAY)) +#define C_RANDOM_PLAY (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_RANDOM_PLAY)) #define C_SHUFFLE (C_RANDOM_PLAY) /* Consumer Repeat */ -#define C_REPEAT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_REPEAT)) +#define C_REPEAT (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_REPEAT)) /* Consumer Slow Tracking */ -#define C_SLOW_TRACKING (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_SLOW_TRACKING)) +#define C_SLOW_TRACKING (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_SLOW_TRACKING)) #define C_SLOW2 (C_SLOW_TRACKING) /* Consumer Stop/Eject */ -#define C_STOP_EJECT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_STOP_EJECT)) +#define C_STOP_EJECT (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_STOP_EJECT)) /* Consumer Play/Pause */ -#define C_PLAY_PAUSE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_PLAY_PAUSE)) +#define C_PLAY_PAUSE (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_PLAY_PAUSE)) #define C_PP (C_PLAY_PAUSE) #define M_PLAY (C_PLAY_PAUSE) // WARNING: DEPRECATED (DO NOT USE) /* Consumer Voice Command */ -#define C_VOICE_COMMAND (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_VOICE_COMMAND)) +#define C_VOICE_COMMAND (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_VOICE_COMMAND)) /* Consumer Mute */ -#define C_MUTE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MUTE)) +#define C_MUTE (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_MUTE)) #define M_MUTE (C_MUTE) // WARNING: DEPRECATED (DO NOT USE) /* Consumer Bass Boost */ -#define C_BASS_BOOST (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_BASS_BOOST)) +#define C_BASS_BOOST (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_BASS_BOOST)) /* Consumer Volume Increment */ -#define C_VOLUME_UP (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_VOLUME_INCREMENT)) +#define C_VOLUME_UP (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_VOLUME_INCREMENT)) #define C_VOL_UP (C_VOLUME_UP) #define M_VOLU (C_VOLUME_UP) // WARNING: DEPRECATED (DO NOT USE) /* Consumer Volume Decrement */ -#define C_VOLUME_DOWN (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_VOLUME_DECREMENT)) +#define C_VOLUME_DOWN (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_VOLUME_DECREMENT)) #define C_VOL_DN (C_VOLUME_DOWN) #define M_VOLD (C_VOLUME_DOWN) // WARNING: DEPRECATED (DO NOT USE) /* Consumer Slow */ -#define C_SLOW (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_SLOW)) +#define C_SLOW (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_SLOW)) /* Consumer Alternate Audio Increment */ #define C_ALTERNATE_AUDIO_INCREMENT \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_ALTERNATE_AUDIO_INCREMENT)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_ALTERNATE_AUDIO_INCREMENT)) #define C_ALT_AUDIO_INC (C_ALTERNATE_AUDIO_INCREMENT) /* Consumer AL Consumer Control Configuration */ #define C_AL_CCC \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_CONSUMER_CONTROL_CONFIGURATION)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_CONSUMER_CONTROL_CONFIGURATION)) /* Consumer AL Word Processor */ -#define C_AL_WORD (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_WORD_PROCESSOR)) +#define C_AL_WORD (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_WORD_PROCESSOR)) /* Consumer AL Text Editor */ -#define C_AL_TEXT_EDITOR (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_TEXT_EDITOR)) +#define C_AL_TEXT_EDITOR (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_TEXT_EDITOR)) /* Consumer AL Spreadsheet */ -#define C_AL_SPREADSHEET (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_SPREADSHEET)) +#define C_AL_SPREADSHEET (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_SPREADSHEET)) #define C_AL_SHEET (C_AL_SPREADSHEET) /* Consumer AL Graphics Editor */ -#define C_AL_GRAPHICS_EDITOR (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_GRAPHICS_EDITOR)) +#define C_AL_GRAPHICS_EDITOR \ + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_GRAPHICS_EDITOR)) /* Consumer AL Presentation App */ -#define C_AL_PRESENTATION (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_PRESENTATION_APP)) +#define C_AL_PRESENTATION \ + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_PRESENTATION_APP)) /* Consumer AL Database App */ -#define C_AL_DATABASE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_DATABASE_APP)) +#define C_AL_DATABASE (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_DATABASE_APP)) #define C_AL_DB (C_AL_DATABASE) /* Consumer AL Email Reader */ -#define C_AL_EMAIL (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_EMAIL_READER)) +#define C_AL_EMAIL (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_EMAIL_READER)) #define C_AL_MAIL (C_AL_EMAIL) /* Consumer AL Newsreader */ -#define C_AL_NEWS (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_NEWSREADER)) +#define C_AL_NEWS (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_NEWSREADER)) /* Consumer AL Voicemail */ -#define C_AL_VOICEMAIL (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_VOICEMAIL)) +#define C_AL_VOICEMAIL (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_VOICEMAIL)) /* Consumer AL Contacts/Address Book */ -#define C_AL_CONTACTS (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_CONTACTS_ADDRESS_BOOK)) +#define C_AL_CONTACTS \ + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_CONTACTS_ADDRESS_BOOK)) #define C_AL_ADDRESS_BOOK (C_AL_CONTACTS) /* Consumer AL Calendar/Schedule */ -#define C_AL_CALENDAR (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_CALENDAR_SCHEDULE)) +#define C_AL_CALENDAR (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_CALENDAR_SCHEDULE)) #define C_AL_CAL (C_AL_CALENDAR) /* Consumer AL Task/Project Manager */ #define C_AL_TASK_MANAGER \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_TASK_PROJECT_MANAGER)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_TASK_PROJECT_MANAGER)) /* Consumer AL Log/Journal/Timecard */ -#define C_AL_JOURNAL (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_LOG_JOURNAL_TIMECARD)) +#define C_AL_JOURNAL (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_LOG_JOURNAL_TIMECARD)) /* Consumer AL Checkbook/Finance */ -#define C_AL_FINANCE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_CHECKBOOK_FINANCE)) +#define C_AL_FINANCE (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_CHECKBOOK_FINANCE)) /* Consumer AL Calculator */ -#define C_AL_CALCULATOR (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_CALCULATOR)) +#define C_AL_CALCULATOR (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_CALCULATOR)) #define C_AL_CALC (C_AL_CALCULATOR) /* Consumer AL A/V Capture/Playback */ #define C_AL_AV_CAPTURE_PLAYBACK \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_A_V_CAPTURE_PLAYBACK)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_A_V_CAPTURE_PLAYBACK)) /* Consumer AL Local Machine Browser */ #define C_AL_MY_COMPUTER \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_LOCAL_MACHINE_BROWSER)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_LOCAL_MACHINE_BROWSER)) /* Consumer AL Internet Browser */ -#define C_AL_WWW (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_INTERNET_BROWSER)) +#define C_AL_WWW (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_INTERNET_BROWSER)) /* Consumer AL Network Chat */ -#define C_AL_NETWORK_CHAT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_NETWORK_CHAT)) +#define C_AL_NETWORK_CHAT (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_NETWORK_CHAT)) #define C_AL_CHAT (C_AL_NETWORK_CHAT) /* Consumer AL Logoff */ -#define C_AL_LOGOFF (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_LOGOFF)) +#define C_AL_LOGOFF (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_LOGOFF)) /* Consumer AL Terminal Lock/Screensaver */ -#define C_AL_LOCK (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_TERMINAL_LOCK_SCREENSAVER)) +#define C_AL_LOCK \ + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_TERMINAL_LOCK_SCREENSAVER)) #define C_AL_SCREENSAVER (C_AL_LOCK) #define C_AL_COFFEE (C_AL_LOCK) /* Consumer AL Control Panel */ -#define C_AL_CONTROL_PANEL (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_CONTROL_PANEL)) +#define C_AL_CONTROL_PANEL (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_CONTROL_PANEL)) /* Consumer AL Select Task/Application */ #define C_AL_SELECT_TASK \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_SELECT_TASK_APPLICATION)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_SELECT_TASK_APPLICATION)) /* Consumer AL Next Task/Application */ -#define C_AL_NEXT_TASK (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_NEXT_TASK_APPLICATION)) +#define C_AL_NEXT_TASK \ + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_NEXT_TASK_APPLICATION)) /* Consumer AL Previous Task/Application */ #define C_AL_PREVIOUS_TASK \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_PREVIOUS_TASK_APPLICATION)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_PREVIOUS_TASK_APPLICATION)) #define C_AL_PREV_TASK (C_AL_PREVIOUS_TASK) /* Consumer AL Integrated Help Center */ -#define C_AL_HELP (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_INTEGRATED_HELP_CENTER)) +#define C_AL_HELP (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_INTEGRATED_HELP_CENTER)) /* Consumer AL Documents */ -#define C_AL_DOCUMENTS (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_DOCUMENTS)) +#define C_AL_DOCUMENTS (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_DOCUMENTS)) #define C_AL_DOCS (C_AL_DOCUMENTS) /* Consumer AL Spell Check */ -#define C_AL_SPELLCHECK (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_SPELL_CHECK)) +#define C_AL_SPELLCHECK (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_SPELL_CHECK)) #define C_AL_SPELL (C_AL_SPELLCHECK) /* Consumer AL Keyboard Layout */ -#define C_AL_KEYBOARD_LAYOUT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_KEYBOARD_LAYOUT)) +#define C_AL_KEYBOARD_LAYOUT \ + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_KEYBOARD_LAYOUT)) /* Consumer AL Screen Saver */ -#define C_AL_SCREEN_SAVER (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_SCREEN_SAVER)) +#define C_AL_SCREEN_SAVER (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_SCREEN_SAVER)) /* Consumer AL File Browser */ -#define C_AL_FILE_BROWSER (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_FILE_BROWSER)) +#define C_AL_FILE_BROWSER (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_FILE_BROWSER)) #define C_AL_FILES (C_AL_FILE_BROWSER) /* Consumer AL Image Browser */ -#define C_AL_IMAGE_BROWSER (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_IMAGE_BROWSER)) +#define C_AL_IMAGE_BROWSER (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_IMAGE_BROWSER)) #define C_AL_IMAGES (C_AL_IMAGE_BROWSER) /* Consumer AL Audio Browser */ -#define C_AL_AUDIO_BROWSER (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_AUDIO_BROWSER)) +#define C_AL_AUDIO_BROWSER (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_AUDIO_BROWSER)) #define C_AL_AUDIO (C_AL_AUDIO_BROWSER) #define C_AL_MUSIC (C_AL_AUDIO_BROWSER) /* Consumer AL Movie Browser */ -#define C_AL_MOVIE_BROWSER (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_MOVIE_BROWSER)) +#define C_AL_MOVIE_BROWSER (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_MOVIE_BROWSER)) #define C_AL_MOVIES (C_AL_MOVIE_BROWSER) /* Consumer AL Instant Messaging */ #define C_AL_INSTANT_MESSAGING \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_INSTANT_MESSAGING)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_INSTANT_MESSAGING)) #define C_AL_IM (C_AL_INSTANT_MESSAGING) /* Consumer AL OEM Features/Tips/Tutorial Browser */ #define C_AL_OEM_FEATURES \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_OEM_FEATURES_TIPS_TUTORIAL_BROWSER)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AL_OEM_FEATURES_TIPS_TUTORIAL_BROWSER)) #define C_AL_TIPS (C_AL_OEM_FEATURES) #define C_AL_TUTORIAL (C_AL_OEM_FEATURES) /* Consumer AC New */ -#define C_AC_NEW (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_NEW)) +#define C_AC_NEW (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_NEW)) /* Consumer AC Open */ -#define C_AC_OPEN (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_OPEN)) +#define C_AC_OPEN (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_OPEN)) /* Consumer AC Close */ -#define C_AC_CLOSE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_CLOSE)) +#define C_AC_CLOSE (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_CLOSE)) /* Consumer AC Exit */ -#define C_AC_EXIT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_EXIT)) +#define C_AC_EXIT (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_EXIT)) /* Consumer AC Save */ -#define C_AC_SAVE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_SAVE)) +#define C_AC_SAVE (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_SAVE)) /* Consumer AC Print */ -#define C_AC_PRINT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_PRINT)) +#define C_AC_PRINT (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_PRINT)) /* Consumer AC Properties */ -#define C_AC_PROPERTIES (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_PROPERTIES)) +#define C_AC_PROPERTIES (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_PROPERTIES)) #define C_AC_PROPS (C_AC_PROPERTIES) /* Consumer AC Undo */ -#define C_AC_UNDO (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_UNDO)) +#define C_AC_UNDO (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_UNDO)) /* Consumer AC Copy */ -#define C_AC_COPY (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_COPY)) +#define C_AC_COPY (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_COPY)) /* Consumer AC Cut */ -#define C_AC_CUT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_CUT)) +#define C_AC_CUT (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_CUT)) /* Consumer AC Paste */ -#define C_AC_PASTE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_PASTE)) +#define C_AC_PASTE (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_PASTE)) /* Consumer AC Find */ -#define C_AC_FIND (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_FIND)) +#define C_AC_FIND (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_FIND)) /* Consumer AC Search */ -#define C_AC_SEARCH (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_SEARCH)) +#define C_AC_SEARCH (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_SEARCH)) /* Consumer AC Go To */ -#define C_AC_GOTO (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_GO_TO)) +#define C_AC_GOTO (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_GO_TO)) /* Consumer AC Home */ -#define C_AC_HOME (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_HOME)) +#define C_AC_HOME (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_HOME)) /* Consumer AC Back */ -#define C_AC_BACK (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_BACK)) +#define C_AC_BACK (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_BACK)) /* Consumer AC Forward */ -#define C_AC_FORWARD (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_FORWARD)) +#define C_AC_FORWARD (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_FORWARD)) /* Consumer AC Stop */ -#define C_AC_STOP (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_STOP)) +#define C_AC_STOP (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_STOP)) /* Consumer AC Refresh */ -#define C_AC_REFRESH (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_REFRESH)) +#define C_AC_REFRESH (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_REFRESH)) /* Consumer AC Bookmarks */ -#define C_AC_BOOKMARKS (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_BOOKMARKS)) +#define C_AC_BOOKMARKS (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_BOOKMARKS)) #define C_AC_FAVORITES (C_AC_BOOKMARKS) #define C_AC_FAVOURITES (C_AC_BOOKMARKS) /* Consumer AC Zoom In */ -#define C_AC_ZOOM_IN (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_ZOOM_IN)) +#define C_AC_ZOOM_IN (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_ZOOM_IN)) /* Consumer AC Zoom Out */ -#define C_AC_ZOOM_OUT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_ZOOM_OUT)) +#define C_AC_ZOOM_OUT (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_ZOOM_OUT)) /* Consumer AC Zoom */ -#define C_AC_ZOOM (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_ZOOM)) +#define C_AC_ZOOM (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_ZOOM)) /* Consumer AC View Toggle */ -#define C_AC_VIEW_TOGGLE (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_VIEW_TOGGLE)) +#define C_AC_VIEW_TOGGLE (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_VIEW_TOGGLE)) /* Consumer AC Scroll Up */ -#define C_AC_SCROLL_UP (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_SCROLL_UP)) +#define C_AC_SCROLL_UP (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_SCROLL_UP)) /* Consumer AC Scroll Down */ -#define C_AC_SCROLL_DOWN (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_SCROLL_DOWN)) +#define C_AC_SCROLL_DOWN (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_SCROLL_DOWN)) /* Consumer AC Edit */ -#define C_AC_EDIT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_EDIT)) +#define C_AC_EDIT (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_EDIT)) /* Consumer AC Cancel */ -#define C_AC_CANCEL (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_CANCEL)) +#define C_AC_CANCEL (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_CANCEL)) /* Consumer AC Insert Mode */ -#define C_AC_INSERT (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_INSERT_MODE)) +#define C_AC_INSERT (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_INSERT_MODE)) #define C_AC_INS (C_AC_INSERT) /* Consumer AC Delete */ -#define C_AC_DEL (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_DELETE)) +#define C_AC_DEL (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_DELETE)) /* Consumer AC Redo/Repeat */ -#define C_AC_REDO (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_REDO_REPEAT)) +#define C_AC_REDO (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_REDO_REPEAT)) /* Consumer AC Reply */ -#define C_AC_REPLY (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_REPLY)) +#define C_AC_REPLY (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_REPLY)) /* Consumer AC Forward Msg */ -#define C_AC_FORWARD_MAIL (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_FORWARD_MSG)) +#define C_AC_FORWARD_MAIL (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_FORWARD_MSG)) /* Consumer AC Send */ -#define C_AC_SEND (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_SEND)) +#define C_AC_SEND (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_SEND)) /* Consumer AC Desktop Show All Windows */ #define C_AC_DESKTOP_SHOW_ALL_WINDOWS \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_DESKTOP_SHOW_ALL_WINDOWS)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_AC_DESKTOP_SHOW_ALL_WINDOWS)) /* Consumer Keyboard Input Assist Previous */ #define C_KEYBOARD_INPUT_ASSIST_PREVIOUS \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_KEYBOARD_INPUT_ASSIST_PREVIOUS)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_KEYBOARD_INPUT_ASSIST_PREVIOUS)) #define C_KBIA_PREV (C_KEYBOARD_INPUT_ASSIST_PREVIOUS) /* Consumer Keyboard Input Assist Next */ #define C_KEYBOARD_INPUT_ASSIST_NEXT \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_KEYBOARD_INPUT_ASSIST_NEXT)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_KEYBOARD_INPUT_ASSIST_NEXT)) #define C_KBIA_NEXT (C_KEYBOARD_INPUT_ASSIST_NEXT) /* Consumer Keyboard Input Assist Previous Group */ #define C_KEYBOARD_INPUT_ASSIST_PREVIOUS_GROUP \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_KEYBOARD_INPUT_ASSIST_PREVIOUS_GROUP)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_KEYBOARD_INPUT_ASSIST_PREVIOUS_GROUP)) #define C_KBIA_PREV_GRP (C_KEYBOARD_INPUT_ASSIST_PREVIOUS_GROUP) /* Consumer Keyboard Input Assist Next Group */ #define C_KEYBOARD_INPUT_ASSIST_NEXT_GROUP \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_KEYBOARD_INPUT_ASSIST_NEXT_GROUP)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_KEYBOARD_INPUT_ASSIST_NEXT_GROUP)) #define C_KBIA_NEXT_GRP (C_KEYBOARD_INPUT_ASSIST_NEXT_GROUP) /* Consumer Keyboard Input Assist Accept */ #define C_KEYBOARD_INPUT_ASSIST_ACCEPT \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_KEYBOARD_INPUT_ASSIST_ACCEPT)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_KEYBOARD_INPUT_ASSIST_ACCEPT)) #define C_KBIA_ACCEPT (C_KEYBOARD_INPUT_ASSIST_ACCEPT) /* Consumer Keyboard Input Assist Cancel */ #define C_KEYBOARD_INPUT_ASSIST_CANCEL \ - (HID_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_KEYBOARD_INPUT_ASSIST_CANCEL)) + (HID_EXT_USAGE(HID_USAGE_CONSUMER, HID_USAGE_CONSUMER_KEYBOARD_INPUT_ASSIST_CANCEL)) #define C_KBIA_CANCEL (C_KEYBOARD_INPUT_ASSIST_CANCEL) diff --git a/app/include/zmk/events/keycode-state-changed.h b/app/include/zmk/events/keycode-state-changed.h index a0e24366..fe47a0fd 100644 --- a/app/include/zmk/events/keycode-state-changed.h +++ b/app/include/zmk/events/keycode-state-changed.h @@ -18,15 +18,14 @@ struct keycode_state_changed { u32_t keycode; u8_t implicit_modifiers; bool state; - s64_t timestamp; }; ZMK_EVENT_DECLARE(keycode_state_changed); -static inline struct keycode_state_changed * -keycode_state_changed_from_encoded(u32_t encoded, bool pressed, s64_t timestamp) { - u16_t page = HID_USAGE_PAGE(encoded) & 0xFF; - u16_t id = HID_USAGE_ID(encoded); +static inline struct keycode_state_changed *keycode_state_changed_from_encoded(u32_t encoded, + bool pressed) { + u16_t page = HID_EXT_USAGE_PAGE(encoded) & 0xFF; + u16_t id = HID_EXT_USAGE_ID(encoded); zmk_mod_flags implicit_mods = SELECT_MODS(encoded); if (!page) { @@ -38,6 +37,5 @@ keycode_state_changed_from_encoded(u32_t encoded, bool pressed, s64_t timestamp) ev->keycode = id; ev->implicit_modifiers = implicit_mods; ev->state = pressed; - ev->timestamp = timestamp; return ev; } diff --git a/app/include/zmk/events/sensor-event.h b/app/include/zmk/events/sensor-event.h index 688f7de9..a9302a5c 100644 --- a/app/include/zmk/events/sensor-event.h +++ b/app/include/zmk/events/sensor-event.h @@ -14,7 +14,6 @@ struct sensor_event { struct zmk_event_header header; u8_t sensor_number; struct device *sensor; - s64_t timestamp; }; ZMK_EVENT_DECLARE(sensor_event); \ No newline at end of file diff --git a/app/include/zmk/hid.h b/app/include/zmk/hid.h index 306bc26b..63cdf3b8 100644 --- a/app/include/zmk/hid.h +++ b/app/include/zmk/hid.h @@ -15,7 +15,7 @@ #define COLLECTION_REPORT 0x03 -#define ZMK_HID_KEYBOARD_NKRO_SIZE 6 +#define ZMK_HID_KEYPAD_NKRO_SIZE 6 #define ZMK_HID_CONSUMER_NKRO_SIZE 6 @@ -37,10 +37,10 @@ static const u8_t zmk_hid_report_desc[] = { HID_USAGE_KEY, /* USAGE_MINIMUM (Keyboard LeftControl) */ HID_LI_USAGE_MIN(1), - HID_USAGE_KEY_KEYBOARD_LEFTCONTROL, + 0xE0, /* USAGE_MAXIMUM (Keyboard Right GUI) */ HID_LI_USAGE_MAX(1), - HID_USAGE_KEY_KEYBOARD_RIGHT_GUI, + 0xE7, /* LOGICAL_MINIMUM (0) */ HID_GI_LOGICAL_MIN(1), 0x00, @@ -89,9 +89,9 @@ static const u8_t zmk_hid_report_desc[] = { /* REPORT_SIZE (1) */ HID_GI_REPORT_SIZE, 0x08, - /* REPORT_COUNT (ZMK_HID_KEYBOARD_NKRO_SIZE) */ + /* REPORT_COUNT (ZMK_HID_KEYPAD_NKRO_SIZE) */ HID_GI_REPORT_COUNT, - ZMK_HID_KEYBOARD_NKRO_SIZE, + ZMK_HID_KEYPAD_NKRO_SIZE, /* INPUT (Data,Ary,Abs) */ HID_MI_INPUT, 0x00, @@ -146,15 +146,15 @@ static const u8_t zmk_hid_report_desc[] = { // u8_t keys[6]; // } __packed; -struct zmk_hid_keyboard_report_body { +struct zmk_hid_keypad_report_body { zmk_mod_flags modifiers; u8_t _reserved; - u8_t keys[ZMK_HID_KEYBOARD_NKRO_SIZE]; + u8_t keys[ZMK_HID_KEYPAD_NKRO_SIZE]; } __packed; -struct zmk_hid_keyboard_report { +struct zmk_hid_keypad_report { u8_t report_id; - struct zmk_hid_keyboard_report_body body; + struct zmk_hid_keypad_report_body body; } __packed; struct zmk_hid_consumer_report_body { @@ -170,13 +170,13 @@ int zmk_hid_register_mod(zmk_mod modifier); int zmk_hid_unregister_mod(zmk_mod modifier); int zmk_hid_implicit_modifiers_press(zmk_mod_flags implicit_modifiers); int zmk_hid_implicit_modifiers_release(); -int zmk_hid_keyboard_press(zmk_key key); -int zmk_hid_keyboard_release(zmk_key key); -void zmk_hid_keyboard_clear(); +int zmk_hid_keypad_press(zmk_key key); +int zmk_hid_keypad_release(zmk_key key); +void zmk_hid_keypad_clear(); int zmk_hid_consumer_press(zmk_key key); int zmk_hid_consumer_release(zmk_key key); void zmk_hid_consumer_clear(); -struct zmk_hid_keyboard_report *zmk_hid_get_keyboard_report(); +struct zmk_hid_keypad_report *zmk_hid_get_keypad_report(); struct zmk_hid_consumer_report *zmk_hid_get_consumer_report(); diff --git a/app/include/zmk/hog.h b/app/include/zmk/hog.h index 7523fb66..a7dda515 100644 --- a/app/include/zmk/hog.h +++ b/app/include/zmk/hog.h @@ -11,5 +11,5 @@ int zmk_hog_init(); -int zmk_hog_send_keyboard_report(struct zmk_hid_keyboard_report_body *body); +int zmk_hog_send_keypad_report(struct zmk_hid_keypad_report_body *body); int zmk_hog_send_consumer_report(struct zmk_hid_consumer_report_body *body); diff --git a/app/run-test.sh b/app/run-test.sh index 89d0f181..dd8c8eed 100755 --- a/app/run-test.sh +++ b/app/run-test.sh @@ -4,27 +4,19 @@ # # SPDX-License-Identifier: MIT # + if [ -z "$1" ]; then echo "Usage: ./run-test.sh " exit 1 -fi - -path="$1" -if [ $path = "all" ]; then - path="tests" -fi - -testcases=$(find $path -name native_posix.keymap -exec dirname \{\} \;) -num_cases=$(echo "$testcases" | wc -l) -if [ $num_cases -gt 1 ]; then +elif [ "$1" = "all" ]; then echo "" > ./build/tests/pass-fail.log - echo "$testcases" | xargs -l -P 4 ./run-test.sh + find tests -name native_posix.keymap -exec dirname \{\} \; | xargs -l -P 4 ./run-test.sh err=$? sort -k2 ./build/tests/pass-fail.log exit $err fi -testcase="$path" +testcase="$1" echo "Running $testcase:" west build -d build/$testcase -b native_posix -- -DZMK_CONFIG=$testcase > /dev/null 2>&1 diff --git a/app/scripts/west-commands.yml b/app/scripts/west-commands.yml deleted file mode 100644 index 75be89da..00000000 --- a/app/scripts/west-commands.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2020, ZMK Contributors -# SPDX-License-Identifier: MIT - -west-commands: - - file: scripts/west_commands/test.py - commands: - - name: test - class: Test - help: run ZMK testsuite diff --git a/app/scripts/west_commands/test.py b/app/scripts/west_commands/test.py deleted file mode 100644 index b8f87c7d..00000000 --- a/app/scripts/west_commands/test.py +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2020 The ZMK Contributors -# -# SPDX-License-Identifier: MIT -'''Test runner for ZMK.''' - -import os -from textwrap import dedent # just for nicer code indentation - -from west.commands import WestCommand -from west import log # use this for user output - - -class Test(WestCommand): - def __init__(self): - super().__init__( - 'test', # gets stored as self.name - 'run ZMK testsuite', # self.help - # self.description: - dedent('''Run the ZMK testsuite.''')) - - def do_add_parser(self, parser_adder): - parser = parser_adder.add_parser(self.name, - help=self.help, - description=self.description) - - parser.add_argument('test_path', default="all", - help='The path to the test. Defaults to "all".', nargs="?") - return parser # gets stored as self.parser - - def do_run(self, args, unknown_args): - # the run-test script assumes the app directory is the current dir. - os.chdir(f'{self.topdir}/app') - exit(os.system(f'{self.topdir}/app/run-test.sh {args.test_path}')) diff --git a/app/src/behaviors/behavior_key_press.c b/app/src/behaviors/behavior_key_press.c index 8559a514..bfcdbfc2 100644 --- a/app/src/behaviors/behavior_key_press.c +++ b/app/src/behaviors/behavior_key_press.c @@ -21,15 +21,15 @@ static int behavior_key_press_init(struct device *dev) { return 0; }; static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event) { LOG_DBG("position %d keycode 0x%02X", event.position, binding->param1); - return ZMK_EVENT_RAISE( - keycode_state_changed_from_encoded(binding->param1, true, event.timestamp)); + + return ZMK_EVENT_RAISE(keycode_state_changed_from_encoded(binding->param1, true)); } static int on_keymap_binding_released(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event) { LOG_DBG("position %d keycode 0x%02X", event.position, binding->param1); - return ZMK_EVENT_RAISE( - keycode_state_changed_from_encoded(binding->param1, false, event.timestamp)); + + return ZMK_EVENT_RAISE(keycode_state_changed_from_encoded(binding->param1, false)); } static const struct behavior_driver_api behavior_key_press_driver_api = { diff --git a/app/src/behaviors/behavior_rgb_underglow.c b/app/src/behaviors/behavior_rgb_underglow.c index 80839a77..2ee6716a 100644 --- a/app/src/behaviors/behavior_rgb_underglow.c +++ b/app/src/behaviors/behavior_rgb_underglow.c @@ -48,14 +48,8 @@ static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding, return -ENOTSUP; } -static int on_keymap_binding_released(struct zmk_behavior_binding *binding, - struct zmk_behavior_binding_event event) { - return 0; -} - static const struct behavior_driver_api behavior_rgb_underglow_driver_api = { .binding_pressed = on_keymap_binding_pressed, - .binding_released = on_keymap_binding_released, }; DEVICE_AND_API_INIT(behavior_rgb_underglow, DT_INST_LABEL(0), behavior_rgb_underglow_init, NULL, diff --git a/app/src/behaviors/behavior_sensor_rotate_key_press.c b/app/src/behaviors/behavior_sensor_rotate_key_press.c index 199ece2f..d0a22961 100644 --- a/app/src/behaviors/behavior_sensor_rotate_key_press.c +++ b/app/src/behaviors/behavior_sensor_rotate_key_press.c @@ -18,8 +18,8 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); static int behavior_sensor_rotate_key_press_init(struct device *dev) { return 0; }; -static int on_sensor_binding_triggered(struct zmk_behavior_binding *binding, struct device *sensor, - s64_t timestamp) { +static int on_sensor_binding_triggered(struct zmk_behavior_binding *binding, + struct device *sensor) { struct sensor_value value; int err; u32_t keycode; @@ -45,12 +45,12 @@ static int on_sensor_binding_triggered(struct zmk_behavior_binding *binding, str LOG_DBG("SEND %d", keycode); - ZMK_EVENT_RAISE(keycode_state_changed_from_encoded(keycode, true, timestamp)); + ZMK_EVENT_RAISE(keycode_state_changed_from_encoded(keycode, true)); // TODO: Better way to do this? k_msleep(5); - return ZMK_EVENT_RAISE(keycode_state_changed_from_encoded(keycode, false, timestamp)); + return ZMK_EVENT_RAISE(keycode_state_changed_from_encoded(keycode, false)); } static const struct behavior_driver_api behavior_sensor_rotate_key_press_driver_api = { diff --git a/app/src/behaviors/behavior_sticky_key.c b/app/src/behaviors/behavior_sticky_key.c deleted file mode 100644 index 5c4c7cbe..00000000 --- a/app/src/behaviors/behavior_sticky_key.c +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#define DT_DRV_COMPAT zmk_behavior_sticky_key - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); - -#if DT_NODE_EXISTS(DT_DRV_INST(0)) - -#define ZMK_BHV_STICKY_KEY_MAX_HELD 10 - -// increase this if you need more keys in the board -#define ZMK_BHV_STICKY_KEY_POSITION_NOT_USED ULONG_MAX - -struct behavior_sticky_key_config { - u32_t release_after_ms; - struct zmk_behavior_binding behavior; -}; - -struct active_sticky_key { - u32_t position; - u32_t param1; - u32_t param2; - const struct behavior_sticky_key_config *config; - // timer data. - bool timer_started; - s64_t release_at; - struct k_delayed_work release_timer; - bool timer_is_cancelled; - // usage page and keycode for the key that is being modified by this sticky key - u8_t modified_key_usage_page; - u32_t modified_key_keycode; -}; - -struct active_sticky_key active_sticky_keys[ZMK_BHV_STICKY_KEY_MAX_HELD] = {}; - -static struct active_sticky_key *store_sticky_key(u32_t position, u32_t param1, u32_t param2, - const struct behavior_sticky_key_config *config) { - for (int i = 0; i < ZMK_BHV_STICKY_KEY_MAX_HELD; i++) { - if (active_sticky_keys[i].position != ZMK_BHV_STICKY_KEY_POSITION_NOT_USED) { - continue; - } - active_sticky_keys[i].position = position; - active_sticky_keys[i].param1 = param1; - active_sticky_keys[i].param2 = param2; - active_sticky_keys[i].config = config; - active_sticky_keys[i].release_at = 0; - active_sticky_keys[i].timer_is_cancelled = false; - active_sticky_keys[i].timer_started = false; - active_sticky_keys[i].modified_key_usage_page = 0; - active_sticky_keys[i].modified_key_keycode = 0; - return &active_sticky_keys[i]; - } - return NULL; -} - -static void clear_sticky_key(struct active_sticky_key *sticky_key) { - sticky_key->position = ZMK_BHV_STICKY_KEY_POSITION_NOT_USED; -} - -static struct active_sticky_key *find_sticky_key(u32_t position) { - for (int i = 0; i < ZMK_BHV_STICKY_KEY_MAX_HELD; i++) { - if (active_sticky_keys[i].position == position) { - return &active_sticky_keys[i]; - } - } - return NULL; -} - -static inline int press_sticky_key_behavior(struct active_sticky_key *sticky_key, s64_t timestamp) { - struct zmk_behavior_binding binding = { - .behavior_dev = sticky_key->config->behavior.behavior_dev, - .param1 = sticky_key->param1, - .param2 = sticky_key->param2, - }; - struct zmk_behavior_binding_event event = { - .position = sticky_key->position, - .timestamp = timestamp, - }; - return behavior_keymap_binding_pressed(&binding, event); -} - -static inline int release_sticky_key_behavior(struct active_sticky_key *sticky_key, - s64_t timestamp) { - struct zmk_behavior_binding binding = { - .behavior_dev = sticky_key->config->behavior.behavior_dev, - .param1 = sticky_key->param1, - .param2 = sticky_key->param2, - }; - struct zmk_behavior_binding_event event = { - .position = sticky_key->position, - .timestamp = timestamp, - }; - return behavior_keymap_binding_released(&binding, event); -} - -static int stop_timer(struct active_sticky_key *sticky_key) { - int timer_cancel_result = k_delayed_work_cancel(&sticky_key->release_timer); - if (timer_cancel_result == -EINPROGRESS) { - // too late to cancel, we'll let the timer handler clear up. - sticky_key->timer_is_cancelled = true; - } - return timer_cancel_result; -} - -static int on_sticky_key_binding_pressed(struct zmk_behavior_binding *binding, - struct zmk_behavior_binding_event event) { - struct device *dev = device_get_binding(binding->behavior_dev); - const struct behavior_sticky_key_config *cfg = dev->config_info; - - struct active_sticky_key *sticky_key = - store_sticky_key(event.position, binding->param1, binding->param2, cfg); - if (sticky_key == NULL) { - LOG_ERR("unable to store sticky key, did you press more than %d sticky_key?", - ZMK_BHV_STICKY_KEY_MAX_HELD); - return 0; - } - - press_sticky_key_behavior(sticky_key, event.timestamp); - LOG_DBG("%d new sticky_key", event.position); - return 0; -} - -static int on_sticky_key_binding_released(struct zmk_behavior_binding *binding, - struct zmk_behavior_binding_event event) { - struct active_sticky_key *sticky_key = find_sticky_key(event.position); - if (sticky_key == NULL) { - LOG_ERR("ACTIVE STICKY KEY CLEARED TOO EARLY"); - return 0; - } - - if (sticky_key->modified_key_usage_page != 0 && sticky_key->modified_key_keycode != 0) { - LOG_DBG("Another key was pressed while the sticky key was pressed. Act like a normal key."); - int retval = release_sticky_key_behavior(sticky_key, event.timestamp); - clear_sticky_key(sticky_key); - return retval; - } - - // No other key was pressed. Start the timer. - sticky_key->timer_started = true; - sticky_key->release_at = event.timestamp + sticky_key->config->release_after_ms; - // adjust timer in case this behavior was queued by a hold-tap - s32_t ms_left = sticky_key->release_at - k_uptime_get(); - if (ms_left > 0) { - k_delayed_work_submit(&sticky_key->release_timer, K_MSEC(ms_left)); - } - return 0; -} - -static const struct behavior_driver_api behavior_sticky_key_driver_api = { - .binding_pressed = on_sticky_key_binding_pressed, - .binding_released = on_sticky_key_binding_released, -}; - -static int sticky_key_keycode_state_changed_listener(const struct zmk_event_header *eh) { - if (!is_keycode_state_changed(eh)) { - return 0; - } - struct keycode_state_changed *ev = cast_keycode_state_changed(eh); - for (int i = 0; i < ZMK_BHV_STICKY_KEY_MAX_HELD; i++) { - struct active_sticky_key *sticky_key = &active_sticky_keys[i]; - if (sticky_key->position == ZMK_BHV_STICKY_KEY_POSITION_NOT_USED) { - continue; - } - - if (strcmp(sticky_key->config->behavior.behavior_dev, "KEY_PRESS") == 0 && - HID_USAGE_ID(sticky_key->param1) == ev->keycode && - HID_USAGE_PAGE(sticky_key->param1) == ev->usage_page && - SELECT_MODS(sticky_key->param1) == ev->implicit_modifiers) { - // don't catch key down events generated by the sticky key behavior itself - continue; - } - - // If events were queued, the timer event may be queued late or not at all. - // Release the sticky key if the timer should've run out in the meantime. - if (sticky_key->release_at != 0 && ev->timestamp > sticky_key->release_at) { - release_sticky_key_behavior(sticky_key, sticky_key->release_at); - if (stop_timer(sticky_key)) { - clear_sticky_key(sticky_key); - } - continue; - } - - if (ev->state) { // key down - if (sticky_key->modified_key_usage_page != 0 || sticky_key->modified_key_keycode != 0) { - // this sticky key is already in use for a keycode - continue; - } - if (sticky_key->timer_started) { - stop_timer(sticky_key); - } - sticky_key->modified_key_usage_page = ev->usage_page; - sticky_key->modified_key_keycode = ev->keycode; - - } else { // key up - if (sticky_key->timer_started && - sticky_key->modified_key_usage_page == ev->usage_page && - sticky_key->modified_key_keycode == ev->keycode) { - release_sticky_key_behavior(sticky_key, ev->timestamp); - stop_timer(sticky_key); - clear_sticky_key(sticky_key); - } - } - } - return 0; -} - -ZMK_LISTENER(behavior_sticky_key, sticky_key_keycode_state_changed_listener); -ZMK_SUBSCRIPTION(behavior_sticky_key, keycode_state_changed); - -void behavior_sticky_key_timer_handler(struct k_work *item) { - struct active_sticky_key *sticky_key = - CONTAINER_OF(item, struct active_sticky_key, release_timer); - if (sticky_key->position == ZMK_BHV_STICKY_KEY_POSITION_NOT_USED) { - return; - } - if (!sticky_key->timer_is_cancelled) { - release_sticky_key_behavior(sticky_key, k_uptime_get()); - } - clear_sticky_key(sticky_key); -} - -static int behavior_sticky_key_init(struct device *dev) { - static bool init_first_run = true; - if (init_first_run) { - for (int i = 0; i < ZMK_BHV_STICKY_KEY_MAX_HELD; i++) { - k_delayed_work_init(&active_sticky_keys[i].release_timer, - behavior_sticky_key_timer_handler); - active_sticky_keys[i].position = ZMK_BHV_STICKY_KEY_POSITION_NOT_USED; - } - } - init_first_run = false; - return 0; -} - -struct behavior_sticky_key_data {}; -static struct behavior_sticky_key_data behavior_sticky_key_data; - -#define _TRANSFORM_ENTRY(idx, node) \ - { \ - .behavior_dev = DT_LABEL(DT_INST_PHANDLE_BY_IDX(node, bindings, idx)), \ - .param1 = COND_CODE_0(DT_INST_PHA_HAS_CELL_AT_IDX(node, bindings, idx, param1), (0), \ - (DT_INST_PHA_BY_IDX(node, bindings, idx, param1))), \ - .param2 = COND_CODE_0(DT_INST_PHA_HAS_CELL_AT_IDX(node, bindings, idx, param2), (0), \ - (DT_INST_PHA_BY_IDX(node, bindings, idx, param2))), \ - }, - -#define KP_INST(n) \ - static struct behavior_sticky_key_config behavior_sticky_key_config_##n = { \ - .behavior = _TRANSFORM_ENTRY(0, n).release_after_ms = DT_INST_PROP(n, release_after_ms), \ - }; \ - DEVICE_AND_API_INIT(behavior_sticky_key_##n, DT_INST_LABEL(n), behavior_sticky_key_init, \ - &behavior_sticky_key_data, &behavior_sticky_key_config_##n, APPLICATION, \ - CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_sticky_key_driver_api); - -DT_INST_FOREACH_STATUS_OKAY(KP_INST) - -#endif \ No newline at end of file diff --git a/app/src/ble.c b/app/src/ble.c index b00bd5c2..1ab61d0c 100644 --- a/app/src/ble.c +++ b/app/src/ble.c @@ -404,7 +404,6 @@ static struct bt_conn_cb conn_callbacks = { .security_changed = security_changed, }; -/* static void auth_passkey_display(struct bt_conn *conn, unsigned int passkey) { char addr[BT_ADDR_LE_STR_LEN]; @@ -412,7 +411,6 @@ static void auth_passkey_display(struct bt_conn *conn, unsigned int passkey) { LOG_DBG("Passkey for %s: %06u", log_strdup(addr), passkey); } -*/ #ifdef CONFIG_ZMK_BLE_PASSKEY_ENTRY diff --git a/app/src/ble_unpair_combo.c b/app/src/ble_unpair_combo.c new file mode 100644 index 00000000..b6e542de --- /dev/null +++ b/app/src/ble_unpair_combo.c @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include + +#define DT_DRV_COMPAT zmk_bt_unpair_combo + +#if DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) + +#include +LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); + +#include +#include +#include + +static u8_t combo_state; + +const u32_t key_positions[] = DT_INST_PROP(0, key_positions); +#define KP_LEN DT_INST_PROP_LEN(0, key_positions) + +int index_for_key_position(u32_t kp) { + for (int i = 0; i < KP_LEN; i++) { + if (key_positions[i] == kp) { + return i; + } + } + + return -1; +} + +int unpair_combo_listener(const struct zmk_event_header *eh) { + if (is_position_state_changed(eh)) { + const struct position_state_changed *psc = cast_position_state_changed(eh); + + int kp_index = index_for_key_position(psc->position); + if (kp_index < 0) { + return 0; + } + + WRITE_BIT(combo_state, kp_index, psc->state); + } + + return 0; +}; + +void unpair_combo_work_handler(struct k_work *work) { + for (int i = 0; i < KP_LEN; i++) { + if (!(combo_state & BIT(i))) { + LOG_DBG("Key position %d not held, skipping unpair combo", key_positions[i]); + return; + } + } + + zmk_ble_unpair_all(); +}; + +struct k_delayed_work unpair_combo_work; + +int zmk_ble_unpair_combo_init(struct device *_unused) { + k_delayed_work_init(&unpair_combo_work, unpair_combo_work_handler); + k_delayed_work_submit(&unpair_combo_work, K_SECONDS(2)); + + return 0; +}; + +ZMK_LISTENER(zmk_ble_unpair_combo, unpair_combo_listener); +ZMK_SUBSCRIPTION(zmk_ble_unpair_combo, position_state_changed); + +SYS_INIT(zmk_ble_unpair_combo_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); + +#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ diff --git a/app/src/endpoints.c b/app/src/endpoints.c index 406d23b6..9a6967c6 100644 --- a/app/src/endpoints.c +++ b/app/src/endpoints.c @@ -53,13 +53,13 @@ int zmk_endpoints_toggle() { return zmk_endpoints_select(new_endpoint); } -static int send_keyboard_report() { - struct zmk_hid_keyboard_report *keyboard_report = zmk_hid_get_keyboard_report(); +static int send_keypad_report() { + struct zmk_hid_keypad_report *keypad_report = zmk_hid_get_keypad_report(); switch (current_endpoint) { #if IS_ENABLED(CONFIG_ZMK_USB) case ZMK_ENDPOINT_USB: { - int err = zmk_usb_hid_send_report((u8_t *)keyboard_report, sizeof(*keyboard_report)); + int err = zmk_usb_hid_send_report((u8_t *)keypad_report, sizeof(*keypad_report)); if (err) { LOG_ERR("FAILED TO SEND OVER USB: %d", err); } @@ -69,7 +69,7 @@ static int send_keyboard_report() { #if IS_ENABLED(CONFIG_ZMK_BLE) case ZMK_ENDPOINT_BLE: { - int err = zmk_hog_send_keyboard_report(&keyboard_report->body); + int err = zmk_hog_send_keypad_report(&keypad_report->body); if (err) { LOG_ERR("FAILED TO SEND OVER HOG: %d", err); } @@ -118,7 +118,7 @@ int zmk_endpoints_send_report(u8_t usage_page) { LOG_DBG("usage page 0x%02X", usage_page); switch (usage_page) { case HID_USAGE_KEY: - return send_keyboard_report(); + return send_keypad_report(); case HID_USAGE_CONSUMER: return send_consumer_report(); default: @@ -207,7 +207,7 @@ static enum zmk_endpoint get_selected_endpoint() { } static void disconnect_current_endpoint() { - zmk_hid_keyboard_clear(); + zmk_hid_keypad_clear(); zmk_hid_consumer_clear(); zmk_endpoints_send_report(HID_USAGE_KEY); diff --git a/app/src/ext_power_generic.c b/app/src/ext_power_generic.c index 76ee00c7..48170304 100644 --- a/app/src/ext_power_generic.c +++ b/app/src/ext_power_generic.c @@ -6,11 +6,8 @@ #define DT_DRV_COMPAT zmk_ext_power_generic -#include #include #include -#include -#include #include #include @@ -28,33 +25,8 @@ struct ext_power_generic_config { struct ext_power_generic_data { struct device *gpio; bool status; -#if IS_ENABLED(CONFIG_SETTINGS) - bool settings_init; -#endif }; -#if IS_ENABLED(CONFIG_SETTINGS) -static void ext_power_save_state_work(struct k_work *work) { - char setting_path[40]; - struct device *ext_power = device_get_binding(DT_INST_LABEL(0)); - struct ext_power_generic_data *data = ext_power->driver_data; - - snprintf(setting_path, 40, "ext_power/state/%s", DT_INST_LABEL(0)); - settings_save_one(setting_path, &data->status, sizeof(data->status)); -} - -static struct k_delayed_work ext_power_save_work; -#endif - -int ext_power_save_state() { -#if IS_ENABLED(CONFIG_SETTINGS) - k_delayed_work_cancel(&ext_power_save_work); - return k_delayed_work_submit(&ext_power_save_work, K_MINUTES(1)); -#else - return 0; -#endif -} - static int ext_power_generic_enable(struct device *dev) { struct ext_power_generic_data *data = dev->driver_data; const struct ext_power_generic_config *config = dev->config_info; @@ -64,7 +36,7 @@ static int ext_power_generic_enable(struct device *dev) { return -EIO; } data->status = true; - return ext_power_save_state(); + return 0; } static int ext_power_generic_disable(struct device *dev) { @@ -76,7 +48,7 @@ static int ext_power_generic_disable(struct device *dev) { return -EIO; } data->status = false; - return ext_power_save_state(); + return 0; } static int ext_power_generic_get(struct device *dev) { @@ -84,46 +56,6 @@ static int ext_power_generic_get(struct device *dev) { return data->status; } -#if IS_ENABLED(CONFIG_SETTINGS) -static int ext_power_settings_set(const char *name, size_t len, settings_read_cb read_cb, - void *cb_arg) { - const char *next; - int rc; - - if (settings_name_steq(name, DT_INST_LABEL(0), &next) && !next) { - struct device *ext_power = device_get_binding(DT_INST_LABEL(0)); - struct ext_power_generic_data *data = ext_power->driver_data; - - if (len != sizeof(data->status)) { - return -EINVAL; - } - - rc = read_cb(cb_arg, &data->status, sizeof(data->status)); - if (rc >= 0) { - data->settings_init = true; - - if (ext_power == NULL) { - LOG_ERR("Unable to retrieve ext_power device: %s", DT_INST_LABEL(0)); - return -EIO; - } - - if (data->status) { - ext_power_generic_enable(ext_power); - } else { - ext_power_generic_disable(ext_power); - } - - return 0; - } - return rc; - } - return -ENOENT; -} - -struct settings_handler ext_power_conf = {.name = "ext_power/state", - .h_set = ext_power_settings_set}; -#endif - static int ext_power_generic_init(struct device *dev) { struct ext_power_generic_data *data = dev->driver_data; const struct ext_power_generic_config *config = dev->config_info; @@ -139,24 +71,6 @@ static int ext_power_generic_init(struct device *dev) { return -EIO; } -#if IS_ENABLED(CONFIG_SETTINGS) - settings_register(&ext_power_conf); - k_delayed_work_init(&ext_power_save_work, ext_power_save_state_work); - - // Set default value (on) if settings isn't set - settings_load_subtree("ext_power"); - if (!data->settings_init) { - - data->status = true; - k_delayed_work_submit(&ext_power_save_work, K_NO_WAIT); - - ext_power_enable(dev); - } -#else - // Default to the ext_power being open when no settings - ext_power_enable(dev); -#endif - return 0; } @@ -165,18 +79,13 @@ static const struct ext_power_generic_config config = { .pin = DT_INST_GPIO_PIN(0, control_gpios), .flags = DT_INST_GPIO_FLAGS(0, control_gpios)}; -static struct ext_power_generic_data data = { - .status = false, -#if IS_ENABLED(CONFIG_SETTINGS) - .settings_init = false, -#endif -}; +static struct ext_power_generic_data data = {.status = false}; static const struct ext_power_api api = {.enable = ext_power_generic_enable, .disable = ext_power_generic_disable, .get = ext_power_generic_get}; DEVICE_AND_API_INIT(ext_power_generic, DT_INST_LABEL(0), ext_power_generic_init, &data, &config, - APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, &api); + APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &api); #endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ diff --git a/app/src/hid.c b/app/src/hid.c index 2d6e6f2b..7e733d96 100644 --- a/app/src/hid.c +++ b/app/src/hid.c @@ -9,8 +9,9 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); #include #include +#include -static struct zmk_hid_keyboard_report keyboard_report = { +static struct zmk_hid_keypad_report kp_report = { .report_id = 1, .body = {.modifiers = 0, ._reserved = 0, .keys = {0}}}; static struct zmk_hid_consumer_report consumer_report = {.report_id = 2, .body = {.keys = {0}}}; @@ -22,8 +23,8 @@ static zmk_mod_flags explicit_modifiers = 0; #define SET_MODIFIERS(mods) \ { \ - keyboard_report.body.modifiers = mods; \ - LOG_DBG("Modifiers set to 0x%02X", keyboard_report.body.modifiers); \ + kp_report.body.modifiers = mods; \ + LOG_DBG("Modifiers set to 0x%02X", kp_report.body.modifiers); \ } int zmk_hid_register_mod(zmk_mod modifier) { @@ -49,12 +50,12 @@ int zmk_hid_unregister_mod(zmk_mod modifier) { return 0; } -#define TOGGLE_KEYBOARD(match, val) \ - for (int idx = 0; idx < ZMK_HID_KEYBOARD_NKRO_SIZE; idx++) { \ - if (keyboard_report.body.keys[idx] != match) { \ +#define TOGGLE_KEYPAD(match, val) \ + for (int idx = 0; idx < ZMK_HID_KEYPAD_NKRO_SIZE; idx++) { \ + if (kp_report.body.keys[idx] != match) { \ continue; \ } \ - keyboard_report.body.keys[idx] = val; \ + kp_report.body.keys[idx] = val; \ break; \ } @@ -77,23 +78,23 @@ int zmk_hid_implicit_modifiers_release() { return 0; } -int zmk_hid_keyboard_press(zmk_key code) { +int zmk_hid_keypad_press(zmk_key code) { if (code >= HID_USAGE_KEY_KEYBOARD_LEFTCONTROL && code <= HID_USAGE_KEY_KEYBOARD_RIGHT_GUI) { return zmk_hid_register_mod(code - HID_USAGE_KEY_KEYBOARD_LEFTCONTROL); } - TOGGLE_KEYBOARD(0U, code); + TOGGLE_KEYPAD(0U, code); return 0; }; -int zmk_hid_keyboard_release(zmk_key code) { +int zmk_hid_keypad_release(zmk_key code) { if (code >= HID_USAGE_KEY_KEYBOARD_LEFTCONTROL && code <= HID_USAGE_KEY_KEYBOARD_RIGHT_GUI) { return zmk_hid_unregister_mod(code - HID_USAGE_KEY_KEYBOARD_LEFTCONTROL); } - TOGGLE_KEYBOARD(code, 0U); + TOGGLE_KEYPAD(code, 0U); return 0; }; -void zmk_hid_keyboard_clear() { memset(&keyboard_report.body, 0, sizeof(keyboard_report.body)); } +void zmk_hid_keypad_clear() { memset(&kp_report.body, 0, sizeof(kp_report.body)); } int zmk_hid_consumer_press(zmk_key code) { TOGGLE_CONSUMER(0U, code); @@ -107,8 +108,8 @@ int zmk_hid_consumer_release(zmk_key code) { void zmk_hid_consumer_clear() { memset(&consumer_report.body, 0, sizeof(consumer_report.body)); } -struct zmk_hid_keyboard_report *zmk_hid_get_keyboard_report() { - return &keyboard_report; +struct zmk_hid_keypad_report *zmk_hid_get_keypad_report() { + return &kp_report; } struct zmk_hid_consumer_report *zmk_hid_get_consumer_report() { diff --git a/app/src/hid_listener.c b/app/src/hid_listener.c index b93abcab..5efb7987 100644 --- a/app/src/hid_listener.c +++ b/app/src/hid_listener.c @@ -23,7 +23,7 @@ static int hid_listener_keycode_pressed(u8_t usage_page, u32_t keycode, implicit_modifiers); switch (usage_page) { case HID_USAGE_KEY: - err = zmk_hid_keyboard_press(keycode); + err = zmk_hid_keypad_press(keycode); if (err) { LOG_ERR("Unable to press keycode"); return err; @@ -48,7 +48,7 @@ static int hid_listener_keycode_released(u8_t usage_page, u32_t keycode, implicit_modifiers); switch (usage_page) { case HID_USAGE_KEY: - err = zmk_hid_keyboard_release(keycode); + err = zmk_hid_keypad_release(keycode); if (err) { LOG_ERR("Unable to release keycode"); return err; diff --git a/app/src/hog.c b/app/src/hog.c index ea61933e..bcd652d2 100644 --- a/app/src/hog.c +++ b/app/src/hog.c @@ -79,9 +79,9 @@ static ssize_t read_hids_report_map(struct bt_conn *conn, const struct bt_gatt_a static ssize_t read_hids_input_report(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, u16_t len, u16_t offset) { - struct zmk_hid_keyboard_report_body *report_body = &zmk_hid_get_keyboard_report()->body; + struct zmk_hid_keypad_report_body *report_body = &zmk_hid_get_keypad_report()->body; return bt_gatt_attr_read(conn, attr, buf, len, offset, report_body, - sizeof(struct zmk_hid_keyboard_report_body)); + sizeof(struct zmk_hid_keypad_report_body)); } static ssize_t read_hids_consumer_input_report(struct bt_conn *conn, @@ -156,7 +156,7 @@ struct bt_conn *destination_connection() { return conn; } -int zmk_hog_send_keyboard_report(struct zmk_hid_keyboard_report_body *report) { +int zmk_hog_send_keypad_report(struct zmk_hid_keypad_report_body *report) { struct bt_conn *conn = destination_connection(); if (conn == NULL) { return -ENOTCONN; @@ -164,8 +164,8 @@ int zmk_hog_send_keyboard_report(struct zmk_hid_keyboard_report_body *report) { LOG_DBG("Sending to NULL? %s", conn == NULL ? "yes" : "no"); - int err = bt_gatt_notify(conn, &hog_svc.attrs[5], report, - sizeof(struct zmk_hid_keyboard_report_body)); + int err = + bt_gatt_notify(conn, &hog_svc.attrs[5], report, sizeof(struct zmk_hid_keypad_report_body)); bt_conn_unref(conn); return err; }; diff --git a/app/src/keymap.c b/app/src/keymap.c index 4174ac1d..1d289e51 100644 --- a/app/src/keymap.c +++ b/app/src/keymap.c @@ -130,12 +130,14 @@ int zmk_keymap_apply_position_state(int layer, u32_t position, bool pressed, s64 } int zmk_keymap_position_state_changed(u32_t position, bool pressed, s64_t timestamp) { - if (pressed) { - zmk_keymap_active_behavior_layer[position] = zmk_keymap_layer_state; - } for (int layer = ZMK_KEYMAP_LAYERS_LEN - 1; layer >= zmk_keymap_layer_default; layer--) { - if (is_active_layer(layer, zmk_keymap_active_behavior_layer[position])) { + u32_t layer_state = + pressed ? zmk_keymap_layer_state : zmk_keymap_active_behavior_layer[position]; + if (is_active_layer(layer, layer_state)) { int ret = zmk_keymap_apply_position_state(layer, position, pressed, timestamp); + + zmk_keymap_active_behavior_layer[position] = zmk_keymap_layer_state; + if (ret > 0) { LOG_DBG("behavior processing to continue to next layer"); continue; @@ -152,7 +154,7 @@ int zmk_keymap_position_state_changed(u32_t position, bool pressed, s64_t timest } #if ZMK_KEYMAP_HAS_SENSORS -int zmk_keymap_sensor_triggered(u8_t sensor_number, struct device *sensor, s64_t timestamp) { +int zmk_keymap_sensor_triggered(u8_t sensor_number, struct device *sensor) { for (int layer = ZMK_KEYMAP_LAYERS_LEN - 1; layer >= zmk_keymap_layer_default; layer--) { if (((zmk_keymap_layer_state & BIT(layer)) == BIT(layer) || layer == zmk_keymap_layer_default) && @@ -171,7 +173,7 @@ int zmk_keymap_sensor_triggered(u8_t sensor_number, struct device *sensor, s64_t continue; } - ret = behavior_sensor_keymap_binding_triggered(binding, sensor, timestamp); + ret = behavior_sensor_keymap_binding_triggered(binding, sensor); if (ret > 0) { LOG_DBG("behavior processing to continue to next layer"); @@ -197,7 +199,7 @@ int keymap_listener(const struct zmk_event_header *eh) { #if ZMK_KEYMAP_HAS_SENSORS } else if (is_sensor_event(eh)) { const struct sensor_event *ev = cast_sensor_event(eh); - return zmk_keymap_sensor_triggered(ev->sensor_number, ev->sensor, ev->timestamp); + return zmk_keymap_sensor_triggered(ev->sensor_number, ev->sensor); #endif /* ZMK_KEYMAP_HAS_SENSORS */ } diff --git a/app/src/main.c b/app/src/main.c index eb0275bd..0551356d 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -20,12 +20,20 @@ LOG_MODULE_REGISTER(zmk, CONFIG_ZMK_LOG_LEVEL); #define ZMK_KSCAN_DEV DT_LABEL(ZMK_MATRIX_NODE_ID) void main(void) { + struct device *ext_power; LOG_INF("Welcome to ZMK!\n"); if (zmk_kscan_init(ZMK_KSCAN_DEV) != 0) { return; } + // Enable the external VCC output + ext_power = device_get_binding("EXT_POWER"); + if (ext_power != NULL) { + const struct ext_power_api *ext_power_api = ext_power->driver_api; + ext_power_api->enable(ext_power); + } + #ifdef CONFIG_ZMK_DISPLAY zmk_display_init(); diff --git a/app/src/rgb_underglow.c b/app/src/rgb_underglow.c index 84eb32d5..084482ea 100644 --- a/app/src/rgb_underglow.c +++ b/app/src/rgb_underglow.c @@ -15,7 +15,6 @@ #include #include -#include LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); @@ -46,14 +45,34 @@ struct rgb_underglow_state { bool on; }; -static struct device *led_strip; +struct device *led_strip; -static struct led_rgb pixels[STRIP_NUM_PIXELS]; +struct led_rgb pixels[STRIP_NUM_PIXELS]; -static struct rgb_underglow_state state; +struct rgb_underglow_state state; -#if IS_ENABLED(CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER) -static struct device *ext_power; +#if IS_ENABLED(CONFIG_SETTINGS) +static int rgb_settings_set(const char *name, size_t len, settings_read_cb read_cb, void *cb_arg) { + const char *next; + int rc; + + if (settings_name_steq(name, "state", &next) && !next) { + if (len != sizeof(state)) { + return -EINVAL; + } + + rc = read_cb(cb_arg, &state, sizeof(state)); + if (rc >= 0) { + return 0; + } + + return rc; + } + + return -ENOENT; +} + +struct settings_handler rgb_conf = {.name = "rgb/underglow", .h_set = rgb_settings_set}; #endif static struct led_rgb hsb_to_rgb(struct led_hsb hsb) { @@ -209,28 +228,6 @@ static void zmk_rgb_underglow_tick_handler(struct k_timer *timer) { K_TIMER_DEFINE(underglow_tick, zmk_rgb_underglow_tick_handler, NULL); #if IS_ENABLED(CONFIG_SETTINGS) -static int rgb_settings_set(const char *name, size_t len, settings_read_cb read_cb, void *cb_arg) { - const char *next; - int rc; - - if (settings_name_steq(name, "state", &next) && !next) { - if (len != sizeof(state)) { - return -EINVAL; - } - - rc = read_cb(cb_arg, &state, sizeof(state)); - if (rc >= 0) { - return 0; - } - - return rc; - } - - return -ENOENT; -} - -struct settings_handler rgb_conf = {.name = "rgb/underglow", .h_set = rgb_settings_set}; - static void zmk_rgb_underglow_save_state_work() { settings_save_one("rgb/underglow/state", &state, sizeof(state)); } @@ -247,13 +244,6 @@ static int zmk_rgb_underglow_init(struct device *_arg) { return -EINVAL; } -#if IS_ENABLED(CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER) - ext_power = device_get_binding("EXT_POWER"); - if (ext_power == NULL) { - LOG_ERR("Unable to retrieve ext_power device: EXT_POWER"); - } -#endif - state = (struct rgb_underglow_state){ hue : CONFIG_ZMK_RGB_UNDERGLOW_HUE_START, saturation : CONFIG_ZMK_RGB_UNDERGLOW_SAT_START, @@ -267,8 +257,6 @@ static int zmk_rgb_underglow_init(struct device *_arg) { #if IS_ENABLED(CONFIG_SETTINGS) settings_register(&rgb_conf); k_delayed_work_init(&underglow_save_work, zmk_rgb_underglow_save_state_work); - - settings_load_subtree("rgb/underglow"); #endif k_timer_start(&underglow_tick, K_NO_WAIT, K_MSEC(50)); @@ -311,22 +299,6 @@ int zmk_rgb_underglow_toggle() { state.on = !state.on; -#if IS_ENABLED(CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER) - if (ext_power != NULL) { - int rc; - - if (state.on) { - rc = ext_power_enable(ext_power); - } else { - rc = ext_power_disable(ext_power); - } - - if (rc != 0) { - LOG_ERR("Unable to toggle EXT_POWER: %d", rc); - } - } -#endif - if (state.on) { state.animation_step = 0; k_timer_start(&underglow_tick, K_NO_WAIT, K_MSEC(50)); diff --git a/app/src/sensors.c b/app/src/sensors.c index f1cfdd15..15f374b3 100644 --- a/app/src/sensors.c +++ b/app/src/sensors.c @@ -48,7 +48,6 @@ static void zmk_sensors_trigger_handler(struct device *dev, struct sensor_trigge event = new_sensor_event(); event->sensor_number = item->sensor_number; event->sensor = dev; - event->timestamp = k_uptime_get(); ZMK_EVENT_RAISE(event); } diff --git a/app/src/split/bluetooth/central.c b/app/src/split/bluetooth/central.c index 2d4d1ed8..ed52ba07 100644 --- a/app/src/split/bluetooth/central.c +++ b/app/src/split/bluetooth/central.c @@ -187,19 +187,19 @@ static bool split_central_eir_found(struct bt_data *data, void *user_data) { for (i = 0; i < data->data_len; i += 16) { struct bt_le_conn_param *param; - struct bt_uuid_128 uuid; + struct bt_uuid uuid; int err; - if (!bt_uuid_create(&uuid.uuid, &data->data[i], 16)) { + if (!bt_uuid_create(&uuid, &data->data[i], 16)) { LOG_ERR("Unable to load UUID"); continue; } - if (bt_uuid_cmp(&uuid.uuid, BT_UUID_DECLARE_128(ZMK_SPLIT_BT_SERVICE_UUID))) { + if (!bt_uuid_cmp(&uuid, BT_UUID_DECLARE_128(ZMK_SPLIT_BT_SERVICE_UUID))) { char uuid_str[BT_UUID_STR_LEN]; char service_uuid_str[BT_UUID_STR_LEN]; - bt_uuid_to_str(&uuid.uuid, uuid_str, sizeof(uuid_str)); + bt_uuid_to_str(&uuid, uuid_str, sizeof(uuid_str)); bt_uuid_to_str(BT_UUID_DECLARE_128(ZMK_SPLIT_BT_SERVICE_UUID), service_uuid_str, sizeof(service_uuid_str)); LOG_DBG("UUID %s does not match split UUID: %s", log_strdup(uuid_str), diff --git a/app/tests/momentary-layer/1-normal/keycode_events.snapshot b/app/tests/momentary-layer/1-normal/keycode_events.snapshot deleted file mode 100644 index 608ce093..00000000 --- a/app/tests/momentary-layer/1-normal/keycode_events.snapshot +++ /dev/null @@ -1,4 +0,0 @@ -mo_pressed: position 1 layer 1 -kp_pressed: usage_page 0x07 keycode 0x06 mods 0x00 -kp_released: usage_page 0x07 keycode 0x06 mods 0x00 -mo_released: position 1 layer 1 diff --git a/app/tests/momentary-layer/1-normal/native_posix.keymap b/app/tests/momentary-layer/1-normal/native_posix.keymap deleted file mode 100644 index 2fc24d2b..00000000 --- a/app/tests/momentary-layer/1-normal/native_posix.keymap +++ /dev/null @@ -1,32 +0,0 @@ -#include -#include -#include -#include "../behavior_keymap.dtsi" - -/ { - keymap { - compatible = "zmk,keymap"; - label ="Default keymap"; - - default_layer { - bindings = < - &kp B &mo 1 - &none &none>; - }; - - layer_1 { - bindings = < - &kp C &trans - &none &none>; - }; - }; -}; - -&kscan { - events = < - ZMK_MOCK_PRESS(0,1,10) - ZMK_MOCK_PRESS(0,0,10) - ZMK_MOCK_RELEASE(0,0,10) - ZMK_MOCK_RELEASE(0,1,10) - >; -}; \ No newline at end of file diff --git a/app/tests/momentary-layer/2-early-key-release/native_posix.keymap b/app/tests/momentary-layer/2-early-key-release/native_posix.keymap deleted file mode 100644 index 9ffa5f6e..00000000 --- a/app/tests/momentary-layer/2-early-key-release/native_posix.keymap +++ /dev/null @@ -1,32 +0,0 @@ -#include -#include -#include -#include "../behavior_keymap.dtsi" - -/ { - keymap { - compatible = "zmk,keymap"; - label ="Default keymap"; - - default_layer { - bindings = < - &kp B &mo 1 - &none &none>; - }; - - layer_1 { - bindings = < - &kp C &none - &none &none>; - }; - }; -}; - -&kscan { - events = < - ZMK_MOCK_PRESS(0,0,10) - ZMK_MOCK_PRESS(0,1,10) - ZMK_MOCK_RELEASE(0,0,10) - ZMK_MOCK_RELEASE(0,1,10) - >; -}; \ No newline at end of file diff --git a/app/tests/momentary-layer/3-covered/events.patterns b/app/tests/momentary-layer/3-covered/events.patterns deleted file mode 100644 index 08b1e987..00000000 --- a/app/tests/momentary-layer/3-covered/events.patterns +++ /dev/null @@ -1,3 +0,0 @@ -s/.*hid_listener_keycode/kp/p -s/.*mo_keymap_binding/mo/p -s/.*keymap_position_state_changed/kp_st/p \ No newline at end of file diff --git a/app/tests/momentary-layer/3-covered/keycode_events.snapshot b/app/tests/momentary-layer/3-covered/keycode_events.snapshot deleted file mode 100644 index 87d12817..00000000 --- a/app/tests/momentary-layer/3-covered/keycode_events.snapshot +++ /dev/null @@ -1,2 +0,0 @@ -mo_pressed: position 1 layer 1 -mo_released: position 1 layer 1 diff --git a/app/tests/momentary-layer/3-covered/native_posix.keymap b/app/tests/momentary-layer/3-covered/native_posix.keymap deleted file mode 100644 index 2484d8b8..00000000 --- a/app/tests/momentary-layer/3-covered/native_posix.keymap +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include -#include - -/* -this test verifies that the correct key is released when a layer is enabled "on top" -and the original key is "covered". -*/ -/ { - keymap { - compatible = "zmk,keymap"; - label ="Default keymap"; - - default_layer { - bindings = < - &trans &mo 1 - &trans &trans>; - }; - - layer_1 { - bindings = < - &trans &kp A - &trans &trans>; - }; - }; -}; - -&kscan { - events = < - ZMK_MOCK_PRESS(0,1,10) - ZMK_MOCK_RELEASE(0,1,10) - >; -}; diff --git a/app/tests/momentary-layer/4-nested/events.patterns b/app/tests/momentary-layer/4-nested/events.patterns deleted file mode 100644 index 08b1e987..00000000 --- a/app/tests/momentary-layer/4-nested/events.patterns +++ /dev/null @@ -1,3 +0,0 @@ -s/.*hid_listener_keycode/kp/p -s/.*mo_keymap_binding/mo/p -s/.*keymap_position_state_changed/kp_st/p \ No newline at end of file diff --git a/app/tests/momentary-layer/4-nested/keycode_events.snapshot b/app/tests/momentary-layer/4-nested/keycode_events.snapshot deleted file mode 100644 index f03e4d5b..00000000 --- a/app/tests/momentary-layer/4-nested/keycode_events.snapshot +++ /dev/null @@ -1,6 +0,0 @@ -mo_pressed: position 1 layer 1 -mo_pressed: position 0 layer 2 -kp_pressed: usage_page 0x07 keycode 0x05 mods 0x00 -kp_released: usage_page 0x07 keycode 0x05 mods 0x00 -mo_released: position 0 layer 2 -mo_released: position 1 layer 1 diff --git a/app/tests/momentary-layer/4-nested/native_posix.keymap b/app/tests/momentary-layer/4-nested/native_posix.keymap deleted file mode 100644 index 0eb77d20..00000000 --- a/app/tests/momentary-layer/4-nested/native_posix.keymap +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include -#include - -/ { - keymap { - compatible = "zmk,keymap"; - label ="Default keymap"; - - default_layer { - bindings = < - &none &mo 1 - &none &none>; - }; - - layer_1 { - bindings = < - &mo 2 &none - &none &none>; - }; - - layer_2 { - bindings = < - &none &none - &kp B &none>; - }; - }; -}; - -&kscan { - events = < - ZMK_MOCK_PRESS(0,1,10) - ZMK_MOCK_PRESS(0,0,10) - ZMK_MOCK_PRESS(1,0,10) - ZMK_MOCK_RELEASE(1,0,10) - ZMK_MOCK_RELEASE(0,0,10) - ZMK_MOCK_RELEASE(0,1,10) - >; -}; \ No newline at end of file diff --git a/app/tests/momentary-layer/5-nested-early-key-release/events.patterns b/app/tests/momentary-layer/5-nested-early-key-release/events.patterns deleted file mode 100644 index 08b1e987..00000000 --- a/app/tests/momentary-layer/5-nested-early-key-release/events.patterns +++ /dev/null @@ -1,3 +0,0 @@ -s/.*hid_listener_keycode/kp/p -s/.*mo_keymap_binding/mo/p -s/.*keymap_position_state_changed/kp_st/p \ No newline at end of file diff --git a/app/tests/momentary-layer/5-nested-early-key-release/keycode_events.snapshot b/app/tests/momentary-layer/5-nested-early-key-release/keycode_events.snapshot deleted file mode 100644 index 15be601e..00000000 --- a/app/tests/momentary-layer/5-nested-early-key-release/keycode_events.snapshot +++ /dev/null @@ -1,6 +0,0 @@ -mo_pressed: position 1 layer 1 -mo_pressed: position 0 layer 2 -kp_pressed: usage_page 0x07 keycode 0x05 mods 0x00 -mo_released: position 1 layer 1 -mo_released: position 0 layer 2 -kp_released: usage_page 0x07 keycode 0x05 mods 0x00 diff --git a/app/tests/momentary-layer/5-nested-early-key-release/native_posix.keymap b/app/tests/momentary-layer/5-nested-early-key-release/native_posix.keymap deleted file mode 100644 index a67035bf..00000000 --- a/app/tests/momentary-layer/5-nested-early-key-release/native_posix.keymap +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include -#include - -/ { - keymap { - compatible = "zmk,keymap"; - label ="Default keymap"; - - default_layer { - bindings = < - &none &mo 1 - &none &none>; - }; - - layer_1 { - bindings = < - &mo 2 &none - &none &none>; - }; - - layer_2 { - bindings = < - &none &none - &kp B &none>; - }; - }; -}; - -&kscan { - events = < - ZMK_MOCK_PRESS(0,1,10) - ZMK_MOCK_PRESS(0,0,10) - ZMK_MOCK_PRESS(1,0,10) - ZMK_MOCK_RELEASE(0,1,10) - ZMK_MOCK_RELEASE(0,0,10) - ZMK_MOCK_RELEASE(1,0,10) - >; -}; \ No newline at end of file diff --git a/app/tests/momentary-layer/behavior_keymap.dtsi b/app/tests/momentary-layer/behavior_keymap.dtsi index a5b6c12b..6cc3140f 100644 --- a/app/tests/momentary-layer/behavior_keymap.dtsi +++ b/app/tests/momentary-layer/behavior_keymap.dtsi @@ -10,13 +10,19 @@ default_layer { bindings = < &kp B &mo 1 - &trans &trans>; + &kp D &kp G>; }; - layer_1 { + lower_layer { bindings = < &kp C_NEXT &trans - &trans &trans>; + &kp L &kp J>; + }; + + raise_layer { + bindings = < + &kp W &kp U + &kp X &kp M>; }; }; }; diff --git a/app/tests/momentary-layer/1-normal/events.patterns b/app/tests/momentary-layer/early-key-release/events.patterns similarity index 100% rename from app/tests/momentary-layer/1-normal/events.patterns rename to app/tests/momentary-layer/early-key-release/events.patterns diff --git a/app/tests/momentary-layer/2-early-key-release/keycode_events.snapshot b/app/tests/momentary-layer/early-key-release/keycode_events.snapshot similarity index 100% rename from app/tests/momentary-layer/2-early-key-release/keycode_events.snapshot rename to app/tests/momentary-layer/early-key-release/keycode_events.snapshot diff --git a/app/tests/sticky-keys/3a-os-dn-kcdn-kcup-up/native_posix.keymap b/app/tests/momentary-layer/early-key-release/native_posix.keymap similarity index 54% rename from app/tests/sticky-keys/3a-os-dn-kcdn-kcup-up/native_posix.keymap rename to app/tests/momentary-layer/early-key-release/native_posix.keymap index 3c33908f..e7628c0e 100644 --- a/app/tests/sticky-keys/3a-os-dn-kcdn-kcup-up/native_posix.keymap +++ b/app/tests/momentary-layer/early-key-release/native_posix.keymap @@ -4,10 +4,5 @@ #include "../behavior_keymap.dtsi" &kscan { - events = < - ZMK_MOCK_PRESS(0,0,10) - ZMK_MOCK_PRESS(1,0,10) - ZMK_MOCK_RELEASE(1,0,10) - ZMK_MOCK_RELEASE(0,0,10) - >; + events = ; }; \ No newline at end of file diff --git a/app/tests/momentary-layer/2-early-key-release/events.patterns b/app/tests/momentary-layer/normal/events.patterns similarity index 100% rename from app/tests/momentary-layer/2-early-key-release/events.patterns rename to app/tests/momentary-layer/normal/events.patterns diff --git a/app/tests/momentary-layer/normal/keycode_events.snapshot b/app/tests/momentary-layer/normal/keycode_events.snapshot new file mode 100644 index 00000000..247128fe --- /dev/null +++ b/app/tests/momentary-layer/normal/keycode_events.snapshot @@ -0,0 +1,4 @@ +mo_pressed: position 1 layer 1 +kp_pressed: usage_page 0x0c keycode 0xb5 mods 0x00 +kp_released: usage_page 0x0c keycode 0xb5 mods 0x00 +mo_released: position 1 layer 1 diff --git a/app/tests/sticky-keys/3b-os-dn-kcdn-up-kcup/native_posix.keymap b/app/tests/momentary-layer/normal/native_posix.keymap similarity index 54% rename from app/tests/sticky-keys/3b-os-dn-kcdn-up-kcup/native_posix.keymap rename to app/tests/momentary-layer/normal/native_posix.keymap index e9290a31..7f736904 100644 --- a/app/tests/sticky-keys/3b-os-dn-kcdn-up-kcup/native_posix.keymap +++ b/app/tests/momentary-layer/normal/native_posix.keymap @@ -4,10 +4,5 @@ #include "../behavior_keymap.dtsi" &kscan { - events = < - ZMK_MOCK_PRESS(0,0,10) - ZMK_MOCK_PRESS(1,0,10) - ZMK_MOCK_RELEASE(0,0,10) - ZMK_MOCK_RELEASE(1,0,10) - >; + events = ; }; \ No newline at end of file diff --git a/app/tests/sticky-keys/1-os-dn-up/events.patterns b/app/tests/sticky-keys/1-os-dn-up/events.patterns deleted file mode 100644 index 833100f6..00000000 --- a/app/tests/sticky-keys/1-os-dn-up/events.patterns +++ /dev/null @@ -1 +0,0 @@ -s/.*hid_listener_keycode_//p \ No newline at end of file diff --git a/app/tests/sticky-keys/1-os-dn-up/keycode_events.snapshot b/app/tests/sticky-keys/1-os-dn-up/keycode_events.snapshot deleted file mode 100644 index 5280f5c1..00000000 --- a/app/tests/sticky-keys/1-os-dn-up/keycode_events.snapshot +++ /dev/null @@ -1,4 +0,0 @@ -pressed: usage_page 0x07 keycode 0x08 mods 0x00 -released: usage_page 0x07 keycode 0x08 mods 0x00 -pressed: usage_page 0x07 keycode 0x04 mods 0x00 -released: usage_page 0x07 keycode 0x04 mods 0x00 diff --git a/app/tests/sticky-keys/1-os-dn-up/native_posix.keymap b/app/tests/sticky-keys/1-os-dn-up/native_posix.keymap deleted file mode 100644 index dd2e6ea5..00000000 --- a/app/tests/sticky-keys/1-os-dn-up/native_posix.keymap +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include -#include -#include "../behavior_keymap.dtsi" - -&kscan { - events = < - ZMK_MOCK_PRESS(0,0,10) - ZMK_MOCK_RELEASE(0,0,1200) - ZMK_MOCK_PRESS(1,0,10) - ZMK_MOCK_RELEASE(1,0,10) - >; -}; \ No newline at end of file diff --git a/app/tests/sticky-keys/2-os-dn-up-kcdn-kcup/events.patterns b/app/tests/sticky-keys/2-os-dn-up-kcdn-kcup/events.patterns deleted file mode 100644 index 833100f6..00000000 --- a/app/tests/sticky-keys/2-os-dn-up-kcdn-kcup/events.patterns +++ /dev/null @@ -1 +0,0 @@ -s/.*hid_listener_keycode_//p \ No newline at end of file diff --git a/app/tests/sticky-keys/2-os-dn-up-kcdn-kcup/keycode_events.snapshot b/app/tests/sticky-keys/2-os-dn-up-kcdn-kcup/keycode_events.snapshot deleted file mode 100644 index dba30cc2..00000000 --- a/app/tests/sticky-keys/2-os-dn-up-kcdn-kcup/keycode_events.snapshot +++ /dev/null @@ -1,8 +0,0 @@ -pressed: usage_page 0x07 keycode 0x08 mods 0x00 -pressed: usage_page 0x07 keycode 0x04 mods 0x00 -released: usage_page 0x07 keycode 0x08 mods 0x00 -released: usage_page 0x07 keycode 0x04 mods 0x00 -pressed: usage_page 0x07 keycode 0x08 mods 0x00 -pressed: usage_page 0x07 keycode 0x04 mods 0x00 -released: usage_page 0x07 keycode 0x08 mods 0x00 -released: usage_page 0x07 keycode 0x04 mods 0x00 diff --git a/app/tests/sticky-keys/2-os-dn-up-kcdn-kcup/native_posix.keymap b/app/tests/sticky-keys/2-os-dn-up-kcdn-kcup/native_posix.keymap deleted file mode 100644 index c96eb9f9..00000000 --- a/app/tests/sticky-keys/2-os-dn-up-kcdn-kcup/native_posix.keymap +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include -#include -#include "../behavior_keymap.dtsi" - -&kscan { - events = < - ZMK_MOCK_PRESS(0,0,10) - ZMK_MOCK_RELEASE(0,0,10) - ZMK_MOCK_PRESS(1,0,10) - ZMK_MOCK_RELEASE(1,0,10) - - /* repeat test to check if cleanup is done correctly */ - ZMK_MOCK_PRESS(0,0,10) - ZMK_MOCK_RELEASE(0,0,10) - ZMK_MOCK_PRESS(1,0,10) - ZMK_MOCK_RELEASE(1,0,10) - >; -}; \ No newline at end of file diff --git a/app/tests/sticky-keys/3a-os-dn-kcdn-kcup-up/events.patterns b/app/tests/sticky-keys/3a-os-dn-kcdn-kcup-up/events.patterns deleted file mode 100644 index 833100f6..00000000 --- a/app/tests/sticky-keys/3a-os-dn-kcdn-kcup-up/events.patterns +++ /dev/null @@ -1 +0,0 @@ -s/.*hid_listener_keycode_//p \ No newline at end of file diff --git a/app/tests/sticky-keys/3a-os-dn-kcdn-kcup-up/keycode_events.snapshot b/app/tests/sticky-keys/3a-os-dn-kcdn-kcup-up/keycode_events.snapshot deleted file mode 100644 index ee8aee01..00000000 --- a/app/tests/sticky-keys/3a-os-dn-kcdn-kcup-up/keycode_events.snapshot +++ /dev/null @@ -1,4 +0,0 @@ -pressed: usage_page 0x07 keycode 0x08 mods 0x00 -pressed: usage_page 0x07 keycode 0x04 mods 0x00 -released: usage_page 0x07 keycode 0x04 mods 0x00 -released: usage_page 0x07 keycode 0x08 mods 0x00 diff --git a/app/tests/sticky-keys/3b-os-dn-kcdn-up-kcup/events.patterns b/app/tests/sticky-keys/3b-os-dn-kcdn-up-kcup/events.patterns deleted file mode 100644 index 833100f6..00000000 --- a/app/tests/sticky-keys/3b-os-dn-kcdn-up-kcup/events.patterns +++ /dev/null @@ -1 +0,0 @@ -s/.*hid_listener_keycode_//p \ No newline at end of file diff --git a/app/tests/sticky-keys/3b-os-dn-kcdn-up-kcup/keycode_events.snapshot b/app/tests/sticky-keys/3b-os-dn-kcdn-up-kcup/keycode_events.snapshot deleted file mode 100644 index 758ed616..00000000 --- a/app/tests/sticky-keys/3b-os-dn-kcdn-up-kcup/keycode_events.snapshot +++ /dev/null @@ -1,4 +0,0 @@ -pressed: usage_page 0x07 keycode 0x08 mods 0x00 -pressed: usage_page 0x07 keycode 0x04 mods 0x00 -released: usage_page 0x07 keycode 0x08 mods 0x00 -released: usage_page 0x07 keycode 0x04 mods 0x00 diff --git a/app/tests/sticky-keys/4-os-dn-up-kcdn-timer-kcup/events.patterns b/app/tests/sticky-keys/4-os-dn-up-kcdn-timer-kcup/events.patterns deleted file mode 100644 index 833100f6..00000000 --- a/app/tests/sticky-keys/4-os-dn-up-kcdn-timer-kcup/events.patterns +++ /dev/null @@ -1 +0,0 @@ -s/.*hid_listener_keycode_//p \ No newline at end of file diff --git a/app/tests/sticky-keys/4-os-dn-up-kcdn-timer-kcup/keycode_events.snapshot b/app/tests/sticky-keys/4-os-dn-up-kcdn-timer-kcup/keycode_events.snapshot deleted file mode 100644 index 758ed616..00000000 --- a/app/tests/sticky-keys/4-os-dn-up-kcdn-timer-kcup/keycode_events.snapshot +++ /dev/null @@ -1,4 +0,0 @@ -pressed: usage_page 0x07 keycode 0x08 mods 0x00 -pressed: usage_page 0x07 keycode 0x04 mods 0x00 -released: usage_page 0x07 keycode 0x08 mods 0x00 -released: usage_page 0x07 keycode 0x04 mods 0x00 diff --git a/app/tests/sticky-keys/4-os-dn-up-kcdn-timer-kcup/native_posix.keymap b/app/tests/sticky-keys/4-os-dn-up-kcdn-timer-kcup/native_posix.keymap deleted file mode 100644 index 84daad69..00000000 --- a/app/tests/sticky-keys/4-os-dn-up-kcdn-timer-kcup/native_posix.keymap +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include -#include -#include "../behavior_keymap.dtsi" - -&kscan { - events = < - ZMK_MOCK_PRESS(0,0,10) - ZMK_MOCK_RELEASE(0,0,800) - ZMK_MOCK_PRESS(1,0,400) - ZMK_MOCK_RELEASE(1,0,10) - >; -}; \ No newline at end of file diff --git a/app/tests/sticky-keys/5-os-kcdn-dn-kcup-up/events.patterns b/app/tests/sticky-keys/5-os-kcdn-dn-kcup-up/events.patterns deleted file mode 100644 index 833100f6..00000000 --- a/app/tests/sticky-keys/5-os-kcdn-dn-kcup-up/events.patterns +++ /dev/null @@ -1 +0,0 @@ -s/.*hid_listener_keycode_//p \ No newline at end of file diff --git a/app/tests/sticky-keys/5-os-kcdn-dn-kcup-up/keycode_events.snapshot b/app/tests/sticky-keys/5-os-kcdn-dn-kcup-up/keycode_events.snapshot deleted file mode 100644 index 99bac8de..00000000 --- a/app/tests/sticky-keys/5-os-kcdn-dn-kcup-up/keycode_events.snapshot +++ /dev/null @@ -1,4 +0,0 @@ -pressed: usage_page 0x07 keycode 0x04 mods 0x00 -pressed: usage_page 0x07 keycode 0x08 mods 0x00 -released: usage_page 0x07 keycode 0x04 mods 0x00 -released: usage_page 0x07 keycode 0x08 mods 0x00 diff --git a/app/tests/sticky-keys/5-os-kcdn-dn-kcup-up/native_posix.keymap b/app/tests/sticky-keys/5-os-kcdn-dn-kcup-up/native_posix.keymap deleted file mode 100644 index 71a0a1bb..00000000 --- a/app/tests/sticky-keys/5-os-kcdn-dn-kcup-up/native_posix.keymap +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include -#include -#include "../behavior_keymap.dtsi" - -&kscan { - events = < - ZMK_MOCK_PRESS(1,0,10) - ZMK_MOCK_PRESS(0,0,10) - ZMK_MOCK_RELEASE(1,0,10) - ZMK_MOCK_RELEASE(0,0,1100) - >; -}; \ No newline at end of file diff --git a/app/tests/sticky-keys/7-os-dn-up-kc1dn-kc2dn-kc1up-kc2up/events.patterns b/app/tests/sticky-keys/7-os-dn-up-kc1dn-kc2dn-kc1up-kc2up/events.patterns deleted file mode 100644 index 833100f6..00000000 --- a/app/tests/sticky-keys/7-os-dn-up-kc1dn-kc2dn-kc1up-kc2up/events.patterns +++ /dev/null @@ -1 +0,0 @@ -s/.*hid_listener_keycode_//p \ No newline at end of file diff --git a/app/tests/sticky-keys/7-os-dn-up-kc1dn-kc2dn-kc1up-kc2up/keycode_events.snapshot b/app/tests/sticky-keys/7-os-dn-up-kc1dn-kc2dn-kc1up-kc2up/keycode_events.snapshot deleted file mode 100644 index a9de7e1b..00000000 --- a/app/tests/sticky-keys/7-os-dn-up-kc1dn-kc2dn-kc1up-kc2up/keycode_events.snapshot +++ /dev/null @@ -1,6 +0,0 @@ -pressed: usage_page 0x07 keycode 0x08 mods 0x00 -pressed: usage_page 0x07 keycode 0x04 mods 0x00 -pressed: usage_page 0x07 keycode 0x05 mods 0x00 -released: usage_page 0x07 keycode 0x08 mods 0x00 -released: usage_page 0x07 keycode 0x04 mods 0x00 -released: usage_page 0x07 keycode 0x05 mods 0x00 diff --git a/app/tests/sticky-keys/7-os-dn-up-kc1dn-kc2dn-kc1up-kc2up/native_posix.keymap b/app/tests/sticky-keys/7-os-dn-up-kc1dn-kc2dn-kc1up-kc2up/native_posix.keymap deleted file mode 100644 index 7a9901bf..00000000 --- a/app/tests/sticky-keys/7-os-dn-up-kc1dn-kc2dn-kc1up-kc2up/native_posix.keymap +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include "../behavior_keymap.dtsi" - -&kscan { - events = < - ZMK_MOCK_PRESS(0,0,10) - ZMK_MOCK_RELEASE(0,0,10) - ZMK_MOCK_PRESS(1,0,10) - ZMK_MOCK_PRESS(1,1,10) - ZMK_MOCK_RELEASE(1,0,100) - ZMK_MOCK_RELEASE(1,1,100) - >; -}; \ No newline at end of file diff --git a/app/tests/sticky-keys/8-lsk-osk-combination/events.patterns b/app/tests/sticky-keys/8-lsk-osk-combination/events.patterns deleted file mode 100644 index 833100f6..00000000 --- a/app/tests/sticky-keys/8-lsk-osk-combination/events.patterns +++ /dev/null @@ -1 +0,0 @@ -s/.*hid_listener_keycode_//p \ No newline at end of file diff --git a/app/tests/sticky-keys/8-lsk-osk-combination/keycode_events.snapshot b/app/tests/sticky-keys/8-lsk-osk-combination/keycode_events.snapshot deleted file mode 100644 index 51660c34..00000000 --- a/app/tests/sticky-keys/8-lsk-osk-combination/keycode_events.snapshot +++ /dev/null @@ -1,8 +0,0 @@ -pressed: usage_page 0x07 keycode 0xe0 mods 0x00 -pressed: usage_page 0x07 keycode 0x1c mods 0x00 -released: usage_page 0x07 keycode 0xe0 mods 0x00 -released: usage_page 0x07 keycode 0x1c mods 0x00 -pressed: usage_page 0x07 keycode 0xe0 mods 0x00 -pressed: usage_page 0x07 keycode 0x1c mods 0x00 -released: usage_page 0x07 keycode 0xe0 mods 0x00 -released: usage_page 0x07 keycode 0x1c mods 0x00 diff --git a/app/tests/sticky-keys/8-lsk-osk-combination/native_posix.keymap b/app/tests/sticky-keys/8-lsk-osk-combination/native_posix.keymap deleted file mode 100644 index 45cef501..00000000 --- a/app/tests/sticky-keys/8-lsk-osk-combination/native_posix.keymap +++ /dev/null @@ -1,47 +0,0 @@ -#include -#include -#include - -/ { - keymap { - compatible = "zmk,keymap"; - label ="Default keymap"; - - default_layer { - bindings = < - &sk E &sl 1 - &kp A &kp B>; - }; - - lower_layer { - bindings = < - &sk LEFT_CONTROL &kp X - &kp Y &kp Z>; - }; - }; -}; - -&kscan { - events = < - /* tap sl lower_layer */ - ZMK_MOCK_PRESS(0,1,10) - ZMK_MOCK_RELEASE(0,1,10) - /* tap sk LEFT_CONTROL */ - ZMK_MOCK_PRESS(0,0,10) - ZMK_MOCK_RELEASE(0,0,10) - /* tap Y */ - ZMK_MOCK_PRESS(1,0,10) - ZMK_MOCK_RELEASE(1,0,10) - - /* repeat */ - /* tap sl */ - ZMK_MOCK_PRESS(0,1,10) - ZMK_MOCK_RELEASE(0,1,10) - /* tap sk */ - ZMK_MOCK_PRESS(0,0,10) - ZMK_MOCK_RELEASE(0,0,10) - /* tap Y */ - ZMK_MOCK_PRESS(1,0,10) - ZMK_MOCK_RELEASE(1,0,10) - >; -}; \ No newline at end of file diff --git a/app/tests/sticky-keys/behavior_keymap.dtsi b/app/tests/sticky-keys/behavior_keymap.dtsi deleted file mode 100644 index ae463966..00000000 --- a/app/tests/sticky-keys/behavior_keymap.dtsi +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include -#include - -/ { - keymap { - compatible = "zmk,keymap"; - label ="Default keymap"; - - default_layer { - bindings = < - &sk E &mo 1 - &kp A &kp B>; - }; - - lower_layer { - bindings = < - &sk LEFT_CONTROL &kp X - &kp Y &kp Z>; - }; - }; -}; diff --git a/app/west.yml b/app/west.yml index a8b0ffcb..cba53ab0 100644 --- a/app/west.yml +++ b/app/west.yml @@ -10,7 +10,6 @@ manifest: - name: zephyr remote: petejohanson revision: zmk-v2.3.0-with-fixes - clone-depth: 1 import: # TODO: Rename once upstream offers option like `exclude` or `denylist` name-blacklist: @@ -37,6 +36,5 @@ manifest: - name: uf2 remote: microsoft path: tools/uf2 - clone-depth: 1 self: - west-commands: scripts/west-commands.yml + path: zmk diff --git a/docs/blog/2020-08-12-zmk-sotf-1.md b/docs/blog/2020-08-12-zmk-sotf-1.md index afa03405..8a3ca7c6 100644 --- a/docs/blog/2020-08-12-zmk-sotf-1.md +++ b/docs/blog/2020-08-12-zmk-sotf-1.md @@ -1,5 +1,5 @@ --- -title: "ZMK State Of The Firmware #1" +title: ZMK State Of The Firmware \#1 author: Pete Johanson author_title: Project Creator author_url: https://gitlab.com/petejohanson @@ -15,13 +15,13 @@ With interest and Discord activity growing, it seemed important to lay out the p There's been lots of various activity in ZMK land! -- [Nicell](https://github.com/Nicell) (nice!nano creator) contributed initial [RGB Underglow](/docs/features/underglow) ([#64](https://github.com/zmkfirmware/zmk/pull/64)) support to ZMK. +- [Nicell](https://github.com/Nicell) (nice!nano creator) contributed initial [RGB Underglow](/docs/feature/underglow) ([#64](https://github.com/zmkfirmware/zmk/pull/64)) support to ZMK. - Tons of [documentation](/docs) work. -- Refactoring ([#73](https://github.com/zmkfirmware/zmk/pull/73), [#74](https://github.com/zmkfirmware/zmk/pull/74)) of [keymaps](/docs/features/keymaps) to make them simpler for users. +- Refactoring ([#73](https://github.com/zmkfirmware/zmk/pull/73), [#74](https://github.com/zmkfirmware/zmk/pull/74)) of [keymaps](/docs/feature/keymaps) to make them simpler for users. - Mod-Tap Behavior (docs coming!) is much improved ([#69](https://github.com/zmkfirmware/zmk/pull/69)) and usable now. - An initial [`setup.sh`](http://localhost:3000/docs/user-setup#user-config-setup-script) script was created, allowing users to quickly bootstrap a "user config" setup and push it to GitHub, where GitHub Actions will build the firmware for you. - Corne shield ([#80](https://github.com/zmkfirmware/zmk/pull/80)) shield definition was added. -- Initial [encoder](/docs/features/encoders) support ([#61](https://github.com/zmkfirmware/zmk/pull/61)) was added. +- Initial [encoder](/docs/feature/encoders) support ([#61](https://github.com/zmkfirmware/zmk/pull/61)) was added. ## Bugs and Showstoppers diff --git a/docs/blog/2020-09-21-zmk-sotf-2.md b/docs/blog/2020-09-21-zmk-sotf-2.md index 1ce61c9a..82278add 100644 --- a/docs/blog/2020-09-21-zmk-sotf-2.md +++ b/docs/blog/2020-09-21-zmk-sotf-2.md @@ -1,5 +1,5 @@ --- -title: "ZMK State Of The Firmware #2" +title: ZMK State Of The Firmware \#2 author: Pete Johanson author_title: Project Creator author_url: https://gitlab.com/petejohanson @@ -16,16 +16,16 @@ Hacktoberfest activity, and a current open call for community feedback on a ZMK So much going on in ZMK! -- Added a new generic [Hold Tap behavior](https://zmkfirmware.dev/docs/behaviors/hold-tap) +- Added a new generic [Hold Tap behavior](https://zmkfirmware.dev/docs/behavior/hold-tap) in [#146](https://github.com/zmkfirmware/zmk/pull/146) which now powers mod-tap, layer-tap, etc. - [okke-formsma] -- [BLE profile/connection management](https://zmkfirmware.dev/docs/behaviors/bluetooth) +- [BLE profile/connection management](https://zmkfirmware.dev/docs/behavior/bluetooth) in [#133](https://github.com/zmkfirmware/zmk/pull/133) - [petejohanson] - Integration tests were added to automate testing of behaviors in [#131](https://github.com/zmkfirmware/zmk/pull/131) by [BrainWart] & [petejohanson] -- [Toggle layer behavior](https://zmkfirmware.dev/docs/behaviors/layers#toggle-layer), e.g. `&tog LOWER`, in +- [Toggle layer behavior](https://zmkfirmware.dev/docs/behavior/layers#toggle-layer), e.g. `&tog LOWER`, in [#98](https://github.com/zmkfirmware/zmk/pull/98) - [BrainWart] - Key fix for dropped press/release over HID [#93](https://github.com/zmkfirmware/zmk/pull/93)/[#96](https://github.com/zmkfirmware/zmk/pull/96) - [careyk007](https://github.com/careyk007) & [petejohanson] - Code formatting standardized using `clang-format` in [#183](https://github.com/zmkfirmware/zmk/pull/183) - [petejohanson] -- [Bootloader reset behavior](https://zmkfirmware.dev/docs/behaviors/reset#bootloader-reset), e.g. `&bootloader`, in [#116](https://github.com/zmkfirmware/zmk/pull/116) - [petejohanson] +- [Bootloader reset behavior](https://zmkfirmware.dev/docs/behavior/reset#bootloader-reset), e.g. `&bootloader`, in [#116](https://github.com/zmkfirmware/zmk/pull/116) - [petejohanson] - Various bug fixes and documentation ## New Shields diff --git a/docs/blog/2020-11-09-zmk-sotf-3.md b/docs/blog/2020-11-09-zmk-sotf-3.md deleted file mode 100644 index 9e250a99..00000000 --- a/docs/blog/2020-11-09-zmk-sotf-3.md +++ /dev/null @@ -1,156 +0,0 @@ ---- -title: "ZMK State Of The Firmware #3" -author: Pete Johanson -author_title: Project Creator -author_url: https://gitlab.com/petejohanson -author_image_url: https://www.gravatar.com/avatar/2001ceff7e9dc753cf96fcb2e6f41110 -tags: [SOTF, keyboards, firmware, oss, ble] ---- - -Welcome to the third ZMK "State Of The Firmware" (SOTF)! - -This update will cover all the major activity since [SOTF #2](/blog/2020/09/21/zmk-sotf-2). This edition comes a bit later than planned, but the amount of features and changes will hopefully make it worth it! - -## Recent Activity - -Here's a summary of the various major changes since last time, broken down by theme: - -### Keymaps/Behaviors - -Tons of activity related to keymaps, so we'll go into more detail this time. - -#### Codes Overhaul - -[innovaker] _completely_ overhauled the set of available codes for keymaps, and simultaneously has created -_beautiful_ [documentation](/docs/codes) to help users visualize the codes, and also understand if they are supported on their particular operating system. - -This also laid the foundation for the other keymap related changes that are now available. - -#### Modified (Shifted) Codes - -[okke-formsma] added the ability to apply modifiers to a code, e.g.: - -``` -&kp LC(C) -``` - -which sends `Control + c` when pressed. This feature is often used on smaller keyboards to achieve "shifted keycodes", e.g. `LS(N1)` to send a `!`. -To make this easier, in addition to all the normal codes, we now have defines for common shifted codes, e.g. `EXCL` for `!`, `AT` for `@`, etc. - -To learn more, check out the [Modifiers](/docs/codes/modifiers) documentation. - -#### Simplified Key Press Behavior - -In previous versions of ZMK, users needed to be careful to select between the `&kp` and `&cp` behaviors in their keymaps, depending on -whether the particular keycode they wanted to send was in the "HID consumer page" or not. Forcing users to understand the difference and get -this right was awkward and error prone. - -[petejohanson] and [innovaker] have reduced this complexity. Users can now simply use `&kp` with all available codes and ZMK will -handle sending the right events to the connected host. - -### Power Management - -Several important power management features have been added to ZMK, helping save power for many use cases. - -#### BLE Battery Level Reporting - -[Nicell] added the necessary [driver](https://github.com/zmkfirmware/zmk/pull/293) and [core code](https://github.com/zmkfirmware/zmk/pull/306) to send BLE battery level notifications to hosts that support displaying them. Testing seems to show this works with Windows and GNOME, but macOS does not display the battery info. - -#### External Power Control - -[megamind4089] added a new [driver](https://github.com/zmkfirmware/zmk/pull/242) and [behavior](https://github.com/zmkfirmware/zmk/pull/258) to allow users to toggle (on/off) the external power supplied by boards such as the nRFMicro -and nice!nano that have specialized hardware for this purpose. - -With this change, you can add - -``` -&ext_power EP_TOG -``` - -to toggle (on/off) the power to external hardware like RGB underglow or OLEDs. Check out the [external power control](/docs/behaviors/power#external-power-control) docs for more info. - -#### Deep Sleep - -[petejohanson] has contributed the initial [deep sleep](https://github.com/zmkfirmware/zmk/pull/211) support to ZMK. This work also -included some automatic power savings by switching to PORT events on the nRF52 chips, which reduces the idle power draw, even without deep sleep. Deep sleep is currently not turned on by default, but will be soon. - -### Miscellaneous - -#### Output Selection - -[joelspadin] added [output selection](/docs/behaviors/outputs) to allow selecting whether to send output over USB or BLE if both are connected. This should now help avoid having "double keypresses" when your keyboard is plugged into a host. - -#### Bootloader Corruption Fix - -[Nicell] has already [blogged about this](/blog/2020/10/03/bootloader-fix), but for those that missed it, a _major_, and incredibly difficult to pin down bug involving corruption of the bootloader on devices using the Adafruit nRF52 bootloader has been fixed by [Nicell]. If you've encountered this bug, flashing the latest firmware should prevent it from reoccurring. Unfortunately, due to the nature of this fix, you will need to re-pair your keyboard with your hosts, as the fix involves changing where settings are stored in the flash of the controller. - -#### Official USB Product ID - -[petejohanson] has gotten an official [USB product ID](https://github.com/openmoko/openmoko-usb-oui/pull/15) assigned to the ZMK Firmware. For anyone looking to uniquely identify a USB device running the ZMK Firmware, you can match on: - -- Vendor ID: `0x1d50` -- Product ID: `0x615e` - -We are incredibly grateful that Openmoko Inc., in the wake of discontinuing the openmoko projects, has made this an option for OSS projects. - -#### Development: Remote Docker Container Integration - -[idan](https://github.com/idan) contributed [VSCode devcontainer integration](https://github.com/zmkfirmware/zmk/pull/209) to make it easier for developers to build and develop ZMK without having to do complicated local toolchain setup and configuration. This also opens up some amazing future flexibility for things like [GitHub Codespaces](https://twitter.com/ZMKFirmware/status/1315760616779505678?s=20). - -There's some follow up tweaks necessary for better supporting using this with user config repositories, which will be available soon. - -## New Shields - -- Reviung41 in [#297](https://github.com/zmkfirmware/zmk/pull/297) - [Nicell] -- Boardsource 3x4 in [#296](https://github.com/zmkfirmware/zmk/pull/296) - [neegool](https://github.com/neegool) -- NIBBLE in [#292](https://github.com/zmkfirmware/zmk/pull/292) - [jaygreco](https://github.com/jaygreco) -- Microdox in [#245](https://github.com/zmkfirmware/zmk/pull/245) - [careyk007](https://github.com/careyk007) -- MakerDiary M60 in [#233](https://github.com/zmkfirmware/zmk/pull/233) - [megamind4089] -- TGX4 in [#226](https://github.com/zmkfirmware/zmk/pull/226) - [mubeenkhan94](https://github.com/mubeenkhan94) -- Quefrency V1 in [#216](https://github.com/zmkfirmware/zmk/pull/216) - [noar-t](https://github.com/noar-t) -- Cradio in [#224](https://github.com/zmkfirmware/zmk/pull/224) - [davidphilipbarr](https://github.com/davidphilipbarr) -- Romac+ in [#198](https://github.com/zmkfirmware/zmk/pull/198) - [reizero00](https://github.com/reizero00) - -## New Boards - -- MakerDiary nRF52840 M.2 Module in [#233](https://github.com/zmkfirmware/zmk/pull/233) - [megamind4089] - -## Testing - -There has been an _amazing_ amount of testing from various users as we develop new features. In particular, we'd like to give a shout out to [tominabox1](https://github.com/tominabox1) who has been tireless in providing detailed and thorough testing of -changes as they are being developed. - -## Coming Soon! - -Some items listed in the last coming soon section are still under active development. - -- OLED work, including battery and USB/BLE connection status - [petejohanson] -- One shot mod/layer behaviors - [okke-formsma] -- A power profiler page for the website, to help users estimate their battery life for a given keyboard - [Nicell] -- A keymap converter to automatically update keymaps to the new codes and use of `&kp` everywhere - [joelspadin] - -## Statistics - -Some statistics of interest for ZMK: - -- GitHub (lifetime stats) - - 210 Closed PRs - - 116 Stars - - 101 Forks -- Discord Chat - - 363 total registered -- Website (last 30 days) - - 8.5K page views - - 766 new users - -## Thanks! - -Thanks again to the numerous contributors and users who have made working on ZMK such a pleasure! - -[okke-formsma]: https://github.com/okke-formsma -[nicell]: https://github.com/Nicell -[petejohanson]: https://github.com/petejohanson -[brainwart]: https://github.com/BrainWart -[innovaker]: https://github.com/innovaker -[megamind4089]: https://github.com/megamind4089 -[joelspadin]: https://github.com/joelspadin diff --git a/docs/docs/assets/bond-clearing/corne.jpg b/docs/docs/assets/bond-clearing/corne.jpg new file mode 100644 index 00000000..1e070a2c Binary files /dev/null and b/docs/docs/assets/bond-clearing/corne.jpg differ diff --git a/app/boards/shields/jian/jian.conf b/docs/docs/assets/bond-clearing/debug.log similarity index 100% rename from app/boards/shields/jian/jian.conf rename to docs/docs/assets/bond-clearing/debug.log diff --git a/docs/docs/assets/bond-clearing/kyria.jpg b/docs/docs/assets/bond-clearing/kyria.jpg new file mode 100644 index 00000000..9fa22a07 Binary files /dev/null and b/docs/docs/assets/bond-clearing/kyria.jpg differ diff --git a/docs/docs/assets/bond-clearing/lily58.jpg b/docs/docs/assets/bond-clearing/lily58.jpg new file mode 100644 index 00000000..4087e7dc Binary files /dev/null and b/docs/docs/assets/bond-clearing/lily58.jpg differ diff --git a/docs/docs/behaviors/bluetooth.md b/docs/docs/behavior/bluetooth.md similarity index 100% rename from docs/docs/behaviors/bluetooth.md rename to docs/docs/behavior/bluetooth.md diff --git a/docs/docs/behaviors/hold-tap.md b/docs/docs/behavior/hold-tap.md similarity index 68% rename from docs/docs/behaviors/hold-tap.md rename to docs/docs/behavior/hold-tap.md index f3c3c664..7ae5fc07 100644 --- a/docs/docs/behaviors/hold-tap.md +++ b/docs/docs/behavior/hold-tap.md @@ -1,5 +1,5 @@ --- -title: Hold-Tap Behavior +title: Hold-tap behavior sidebar_label: Hold-Tap --- @@ -21,14 +21,6 @@ By default, the hold-tap is configured to also select the 'hold' functionality i We call this the 'hold-preferred' flavor of hold-taps. While this flavor may work very well for a ctrl/escape key, it's not very well suited for home-row mods or layer-taps. That's why there are two more flavors to choose from: 'tap-preferred' and 'balanced'. -#### Flavors - -- The 'hold-preferred' flavor triggers the hold behavior when the tapping_term_ms has expired or another key is pressed. -- The 'balanced' flavor will trigger the hold behavior when the tapping_term_ms has expired or another key is pressed and released. -- The 'tap-preferred' flavor triggers the hold behavior when the tapping_term_ms has expired. It triggers the tap behavior when another key is pressed. - -When the hold-tap key is released and the hold behavior has not been triggered, the tap behavior will trigger. - ![Hold-tap comparison](../assets/hold-tap/comparison.png) ### Basic usage @@ -37,7 +29,7 @@ For basic usage, please see [mod-tap](./mod-tap.md) and [layer-tap](./layers.md) ### Advanced Configuration -This example configures a hold-tap that works well for homerow mods: +A code example which configures a mod-tap setting that works with homerow mods: ``` #include @@ -49,8 +41,8 @@ This example configures a hold-tap that works well for homerow mods: compatible = "zmk,behavior-hold-tap"; label = "HOMEROW_MODS"; #binding-cells = <2>; - tapping_term_ms = <150>; - flavor = "tap-preferred"; + tapping_term_ms = <175>; + flavor = "balanced"; bindings = <&kp>, <&kp>; }; }; @@ -68,7 +60,9 @@ This example configures a hold-tap that works well for homerow mods: ``` -If this config does not work for you, try the flavor "balanced" with a medium tapping_term_ms such as 200ms. +If this config does not work for you, try the flavor "tap-preferred" and a short tapping_term_ms such as 120ms. + +If you want to use a tap-hold with a keycode from a different code page, you have to define another behavior with another "bindings" parameter.For example, if you want to use SHIFT and volume up, define the bindings like `bindings = <&kp>, <&kp>;`. Only single-argument behaviors are supported at the moment. #### Comparison to QMK diff --git a/docs/docs/behaviors/key-press.md b/docs/docs/behavior/key-press.md similarity index 68% rename from docs/docs/behaviors/key-press.md rename to docs/docs/behavior/key-press.md index 859c7973..dcf1a132 100644 --- a/docs/docs/behaviors/key-press.md +++ b/docs/docs/behavior/key-press.md @@ -19,7 +19,7 @@ The categories of supported codes are: Please visit the [codes](../codes) section for a comprehensive list. -For advanced users, user-defined HID usages are also supported but must be encoded, please see [`dt-bindings/zmk/keys.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/keys.h) for further insight. +For advanced users, user-defined HID codes are also supported but must be encoded, please see [`dt-bindings/zmk/keys.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/keys.h) for further insight. ## Keycode Defines @@ -33,19 +33,24 @@ provided by ZMK near the top: Doing so makes a set of defines such as `A`, `N1`, etc. available for use with these behaviors +:::note +There is an [open issue](https://github.com/zmkfirmware/zmk/issues/21) to provide a more comprehensive, and +complete set of defines for the full keypad and consumer usage pages in the future for ZMK. +::: + ### Improperly defined keymap - `dtlib.DTError: .dts.pre.tmp:` When compiling firmware from a keymap, it may be common to encounter an error in the form of a`dtlib.DTError: .dts.pre.tmp:`. For instructions to resolve such an error, click [here](../troubleshooting###Improperly-defined-keymap) -## Key Press +## Keypad Key Press -The "key press" behavior sends standard keycodes on press/release. +The "keypad key press" behavior sends standard keypad keycodes on press/release. ### Behavior Binding - Reference: `&kp` -- Parameter: The keycode usage ID from the usage page, e.g. `4` or `A` +- Parameter: The keycode usage ID from the keypad usage page, e.g. `4` or `A` Example: diff --git a/docs/docs/behaviors/layers.md b/docs/docs/behavior/layers.md similarity index 100% rename from docs/docs/behaviors/layers.md rename to docs/docs/behavior/layers.md diff --git a/docs/docs/behaviors/lighting.md b/docs/docs/behavior/lighting.md similarity index 100% rename from docs/docs/behaviors/lighting.md rename to docs/docs/behavior/lighting.md diff --git a/docs/docs/behaviors/misc.md b/docs/docs/behavior/misc.md similarity index 100% rename from docs/docs/behaviors/misc.md rename to docs/docs/behavior/misc.md diff --git a/docs/docs/behaviors/mod-tap.md b/docs/docs/behavior/mod-tap.md similarity index 61% rename from docs/docs/behaviors/mod-tap.md rename to docs/docs/behavior/mod-tap.md index 6404a220..da8b438a 100644 --- a/docs/docs/behaviors/mod-tap.md +++ b/docs/docs/behavior/mod-tap.md @@ -5,10 +5,7 @@ sidebar_label: Mod-Tap ## Summary -The Mod-Tap behavior sends a different keypress, depending on whether it's held or tapped. - -- If you hold the key for longer than 200ms, the first keycode ("mod") is sent. -- If you tap the key (release before 200ms), the second keycode ("tap") is sent. +The Mod-Tap sends a different keypress, if it's tapped or held. When you tap the key shortly, the first keycode is sent. If you hold the key for longer than 200ms, the second keycode is sent. If you press another key within the 200ms, the 'mod' behavior is also activated. @@ -43,7 +40,3 @@ You can configure a different tapping term in your keymap: } } ``` - -### Additional information - -The mod-tap is a [hold-tap](./hold-tap.md) under the hood with the "balanced" flavor and tapping_term_ms 200. diff --git a/docs/docs/behaviors/outputs.md b/docs/docs/behavior/outputs.md similarity index 100% rename from docs/docs/behaviors/outputs.md rename to docs/docs/behavior/outputs.md diff --git a/docs/docs/behaviors/power.md b/docs/docs/behavior/power.md similarity index 100% rename from docs/docs/behaviors/power.md rename to docs/docs/behavior/power.md diff --git a/docs/docs/behaviors/reset.md b/docs/docs/behavior/reset.md similarity index 100% rename from docs/docs/behaviors/reset.md rename to docs/docs/behavior/reset.md diff --git a/docs/docs/bond-reset.md b/docs/docs/bond-reset.md new file mode 100644 index 00000000..a16b94d4 --- /dev/null +++ b/docs/docs/bond-reset.md @@ -0,0 +1,30 @@ +--- +id: bond-reset +title: Reset BLE Connections (DEPRECATED) +sidebar_label: BLE Reset (DEPRECATED) +--- + +Known as a 'bond reset', each keyboard has a special key combination independent of the user defined key map which will +clear all wireless connection configurations. The keys must be held for 3 to 5 seconds after the device is +reset. + +:::warning +Currently, ZMK only supports a single BLE host. If you remove the keyboard from the host's bluetooth devices +list, you will need to clear the bonds. +::: + +## Split Keyboards + +Split keyboards will need to be cleared on both halves. For best results try to reset them at the same time. + +### Kyria + +![Kyria bond-reset combo](assets/bond-clearing/kyria.jpg) + +### Corne + +![Corne bond-reset combo](assets/bond-clearing/corne.jpg) + +### Lily58 + +![Lily58 bond-reset combo](assets/bond-clearing/lily58.jpg) diff --git a/docs/docs/codes/_keyboard-keypad.mdx b/docs/docs/codes/_keyboard-keypad.mdx index a00a4f4f..b1852d64 100644 --- a/docs/docs/codes/_keyboard-keypad.mdx +++ b/docs/docs/codes/_keyboard-keypad.mdx @@ -24,8 +24,6 @@ import Table from "@site/src/components/codes/Table"; ### Modifiers -The [Modifiers](./modifiers) page includes further information. - ### Locks diff --git a/docs/docs/codes/modifiers.mdx b/docs/docs/codes/modifiers.mdx deleted file mode 100644 index c573a670..00000000 --- a/docs/docs/codes/modifiers.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: Modifiers -sidebar_label: Modifiers -hide_title: true ---- - -import OsLegend from "@site/src/components/codes/OsLegend"; -import ToastyContainer from "@site/src/components/codes/ToastyContainer"; -import Table from "@site/src/components/codes/Table"; - - - - -## Modifiers - -Modifiers are the special keyboard keys: _shift_, _alt_, _control_ & _GUI_. - -Modifiers can be used in two forms within ZMK: - -- Modifier [Keys](#modifier-keys) β†’ `LEFT_SHIFT` -- Modifier [Functions](#modifier-functions) β†’ `LS(code)` - -
- -### Modifier Keys - -These act like any other key code. - -- e.g. `&kp LEFT_GUI` pushes and releases the left GUI key. - -### Modifier Functions - -Modifier functions add one or more modifiers to a code. - -These functions take the form: `XX(code)` - -- Modifier functions apply a modifier to a code: - - `&kp LS(A)` = `LEFT_SHIFT`+`A` (a capitalized **A**). -- They can be combined: - - `&kp LC(RA(B))` = `LEFT_CONTROL`+`RIGHT_ALT`+`B` -- Some basic codes already include a modifier function in their definition: - - `DOLLAR` = `LS(NUMBER_4)` -- There are left- and right-handed versions of each modifier (also see table above): - - `LS`, `LC`, `LA`, `LG`, `RS`, `RC`, `RA`, `RG` -- Modified keys can safely be rolled-over. Modifier functions are released when another key is pressed. - - Press `&kp LS(A)`, then press `&kp B`, release `&kp LS(A)` and release `&kp B` results in **Ab**. Only the A is capitalized. diff --git a/docs/docs/customization.md b/docs/docs/customization.md index 626a291b..b42656d8 100644 --- a/docs/docs/customization.md +++ b/docs/docs/customization.md @@ -1,4 +1,5 @@ --- +id: customization title: Customizing ZMK/`zmk-config` folders sidebar_label: Customizing ZMK --- @@ -26,7 +27,7 @@ various config settings that can be commented/uncommented to modify how your fir ## Keymap Once you have the basic user config completed, you can find the keymap file in `config/.keymap` and customize from there. -Refer to the [Keymap](/docs/features/keymaps) documentation to learn more. +Refer to the [Keymap](/docs/feature/keymaps) documentation to learn more. ## Publishing @@ -39,7 +40,7 @@ If you need to, a review of [Learn The Basics Of Git In Under 10 Minutes](https: ## Building from a local `zmk` fork using `zmk-config` -[As outlined here](development/build-flash), firmware comes in the form of .uf2 files, which can be built locally using the command `west build`. Normally, +[As outlined here](dev-build-flash), firmware comes in the form of .uf2 files, which can be built locally using the command `west build`. Normally, `west build` will default to using the in-tree .keymap and .conf files found in your local copy of the `zmk` repository. However, you can append the command, `-DZMK_CONFIG="C:/the/absolute/path/config"` to `west build` in order to use the contents of your `zmk-config` folder instead of the default keyboard settings. **Notice that this path should point to the folder labelled `config` within your `zmk-config` folder.** diff --git a/docs/docs/development/boards-shields-keymaps.md b/docs/docs/dev-boards-shields-keymaps.md similarity index 98% rename from docs/docs/development/boards-shields-keymaps.md rename to docs/docs/dev-boards-shields-keymaps.md index e78f5d38..9ed5a328 100644 --- a/docs/docs/development/boards-shields-keymaps.md +++ b/docs/docs/dev-boards-shields-keymaps.md @@ -1,4 +1,5 @@ --- +id: dev-boards-shields-keymaps title: Boards, Shields, and Keymaps --- @@ -34,7 +35,7 @@ in the `app/boards/${arch}/${board_name}` directory, e.g. `app/boards/arm/planck ## Pro Micro Compatible Keyboard -![Labelled Pro Micro pins](../assets/pro-micro/pro-micro-pins-labelled.jpg) +![Labelled Pro Micro pins](assets/pro-micro/pro-micro-pins-labelled.jpg) For keyboards that require a (usually Pro Micro compatible) add-on board to operate, the ZMK integration pieces are places in the _shield_ definition for that keyboard, allowing users to diff --git a/docs/docs/development/build-flash.md b/docs/docs/dev-build.md similarity index 72% rename from docs/docs/development/build-flash.md rename to docs/docs/dev-build.md index e270a7c6..3e6b19ad 100644 --- a/docs/docs/development/build-flash.md +++ b/docs/docs/dev-build.md @@ -1,4 +1,5 @@ --- +id: dev-build-flash title: Building and Flashing sidebar_label: Building and Flashing --- @@ -90,7 +91,7 @@ This produces `left` and `right` subfolders under the `build` directory and two ### Building from `zmk-config` Folder -Instead of building .uf2 files using the default keymap and config files, you can build directly from your [`zmk-config` folder](../user-setup#github-repo) by adding +Instead of building .uf2 files using the default keymap and config files, you can build directly from your [`zmk-config` folder](user-setup#github-repo) by adding `-DZMK_CONFIG="C:/the/absolute/path/config"` to your `west build` command. **Notice that this path should point to the folder labelled `config` within your `zmk-config` folder.** For instance, building kyria firmware from a user `myUser`'s `zmk-config` folder on Windows 10 may look something like this: @@ -99,23 +100,6 @@ For instance, building kyria firmware from a user `myUser`'s `zmk-config` folder west build -b nice_nano -- -DSHIELD=kyria_left -DZMK_CONFIG="C:/Users/myUser/Documents/Github/zmk-config/config" ``` -In order to make your `zmk-config` folder available when building within the VSCode Remote Container, you need to create a docker volume named `zmk-config` -by binding it to the full path of your config directory. If you have run the VSCode Remote Container before, it is likely that docker has created this -volume automatically -- we need to delete the default volume before binding it to the correct path. Follow the following steps: - -1. Stop the container by exiting VSCode. You can verify no container is running via the command `docker ps`. -1. Remove all the containers that are not running via the command `docker container prune`. We need to remove the ZMK container before we can delete the default `zmk-config` volume referenced by it. If you do not want to delete all the containers that are not running, you can find the id of the ZMK container and use `docker rm` to delete that one only. -1. Remove the default volume via the command `docker volume rm zmk-config`. - -Then you can bind the `zmk-config` volume to the correct path pointing to your local [zmk-config](./customization.md) folder: - -``` -docker volume create --driver local -o o=bind -o type=none -o \ - device="/full/path/to/your/zmk-config/" zmk-config -``` - -Now start VSCode and rebuild the container after being prompted. You should be able to see your zmk-config mounted to `/workspaces/zmk-config` inside the container. So you can build your custom firmware with `-DZMK_CONFIG="/workspaces/zmk-config/config"`. - ## Flashing Once built, the previously supplied parameters will be remembered so you can run the following to flash your diff --git a/docs/docs/development/clean-room.md b/docs/docs/dev-clean-room.md similarity index 98% rename from docs/docs/development/clean-room.md rename to docs/docs/dev-clean-room.md index 82db3a04..2f301ec7 100644 --- a/docs/docs/development/clean-room.md +++ b/docs/docs/dev-clean-room.md @@ -1,4 +1,5 @@ --- +id: dev-clean-room title: Clean Room Implementation sidebar_label: Clean Room --- diff --git a/docs/docs/development/new-shield.md b/docs/docs/dev-guide-new-shield.md similarity index 91% rename from docs/docs/development/new-shield.md rename to docs/docs/dev-guide-new-shield.md index 306f1b3f..f3491ddd 100644 --- a/docs/docs/development/new-shield.md +++ b/docs/docs/dev-guide-new-shield.md @@ -1,10 +1,10 @@ --- +id: dev-guide-new-shield title: New Keyboard Shield --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -import KeymapExampleFile from '../keymap-example-file.md'; ## Overview @@ -110,7 +110,7 @@ endif ## Shield Overlays -![Labelled Pro Micro pins](../assets/pro-micro/pro-micro-pins-labelled.jpg) +![Labelled Pro Micro pins](assets/pro-micro/pro-micro-pins-labelled.jpg) ZMK uses the green color coded pin names to generate devicetree node references. For example, to refer to the node `D0` in the devicetree files, use `&pro_micro_d 0` or to refer to `A1`, use `&pro_micro_a 1`. @@ -356,7 +356,33 @@ Each keyboard should provide an OOTB default keymap to be used when building the Here is an example simple keymap for the Kyria, with only one layer: - +``` +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { +// -------------------------------------------------------------------------------------------------------------------------------------------------------------------- +// | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ | +// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | +// | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | L SHIFT | L SHIFT | N | M | , | . | / | R CTRL | +// | GUI | DEL | RETURN | SPACE | ESCAPE | | RETURN | SPACE | TAB | BSPC | R ALT | + bindings = < + &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH + &kp TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp QUOTE + &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp LSHFT &kp LSHFT &kp LSHFT &kp LSHFT &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RCTRL + &kp LGUI &kp DEL &kp RET &kp SPACE &kp ESC &kp RET &kp SPACE &kp TAB &kp BSPC &kp RALT + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + }; +}; + +``` :::note The two `#include` lines at the top of the keymap are required in order to bring in the default set of behaviors to make them available to bind, and to import a set of defines for the key codes, so keymaps can use parameters like `N2` or `K` instead of the raw keycode numeric values. @@ -452,7 +478,7 @@ Add the following line to your keymap file to add default encoder behavior bindi sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; ``` -Add additional bindings as necessary to match the default number of encoders on your board. See the [Encoders](/docs/features/encoders) and [Keymap](/docs/features/keymaps) feature documentation for more details. +Add additional bindings as necessary to match the default number of encoders on your board. See the [Encoders](/docs/feature/encoders) and [Keymap](/docs/feature/keymaps) feature documentation for more details. @@ -474,7 +500,7 @@ west flash :::note Further testing your keyboard shield without altering the root keymap file can be done with the use of `-DZMK_CONFIG` in your `west build` command, -shown [here](build-flash#building-from-zmk-config-folder) +shown [here](dev-build-flash#building-from-zmk-config-folder) ::: ## Updating `build.yml` diff --git a/docs/docs/development/usb-logging.md b/docs/docs/dev-guide-usb-logging.md similarity index 96% rename from docs/docs/development/usb-logging.md rename to docs/docs/dev-guide-usb-logging.md index 6e4e2bef..50884be5 100644 --- a/docs/docs/development/usb-logging.md +++ b/docs/docs/dev-guide-usb-logging.md @@ -1,4 +1,5 @@ --- +id: dev-guide-usb-logging title: USB Logging --- @@ -80,9 +81,9 @@ sudo tio /dev/ttyACM0 On Windows, you can use [PuTTY](https://www.putty.org/). Once installed, use Device Manager to figure out which COM port your controller is communicating on (listed under 'Ports (COM & LPT)') and specify that as the 'Serial line' in PuTTY. -![Controller COM port](../assets/usb-logging/com.jpg) +![Controller COM port](./assets/usb-logging/com.jpg) -![PuTTY settings](../assets/usb-logging/putty.jpg) +![PuTTY settings](assets/usb-logging/putty.jpg) If you already have the Ardunio IDE installed you can also use its built-in Serial Monitor. diff --git a/docs/docs/development/posix-board.md b/docs/docs/dev-posix-board.md similarity index 97% rename from docs/docs/development/posix-board.md rename to docs/docs/dev-posix-board.md index 71460a87..e146bf1f 100644 --- a/docs/docs/development/posix-board.md +++ b/docs/docs/dev-posix-board.md @@ -1,4 +1,5 @@ --- +id: dev-posix-board title: Native Posix board target --- diff --git a/docs/docs/development/setup.md b/docs/docs/dev-setup.md similarity index 96% rename from docs/docs/development/setup.md rename to docs/docs/dev-setup.md index 441299a9..604f987d 100644 --- a/docs/docs/development/setup.md +++ b/docs/docs/dev-setup.md @@ -1,4 +1,5 @@ --- +id: dev-setup title: Basic Setup sidebar_label: Basic Setup --- @@ -411,7 +412,7 @@ cd zmk Open the `zmk` checkout folder in VS Code. The repository includes a configuration for containerized development, so an alert will pop up: -![VS Code Dev Container Configuration Alert](../assets/dev-setup/vscode_devcontainer.png) +![VS Code Dev Container Configuration Alert](assets/dev-setup/vscode_devcontainer.png) Click `Reopen in Container` in order to reopen the VS Code with the running container. @@ -449,7 +450,7 @@ This step pulls down quite a bit of tooling. Go grab a cup of coffee, it can tak :::info If you're using Docker, you're done with setup! You must restart the container at this point. The easiest way to do so is to close the VS Code window, verify that the container has stopped in Docker Dashboard, and reopen the container with VS Code. -Once your container is restarted, proceed to [Building and Flashing](./development/build-flash.md). +Once your container is restarted, proceed to [Building and Flashing](./dev-build.md). ::: #### Export Zephyrβ„’ Core @@ -480,23 +481,23 @@ On Windows, only two environment variables need to be set for ZMK to build prope 1. Open Start Menu and type 'env' to find the 'Edit the system environment variables' option. Open it. -![Environment variables in Start Menu](../assets/env-var/start_menu.png) +![Environment variables in Start Menu](assets/env-var/start_menu.png) 2. Click 'Environment Variables...'. -![Environment variables button](../assets/env-var/env_var.png) +![Environment variables button](assets/env-var/env_var.png) 3. Click "New..." under System variables to create a new system variable. -![Environment variables menu](../assets/env-var/new_variable.png) +![Environment variables menu](assets/env-var/new_variable.png) 4. Set the variable name to 'ZEPHYR_TOOLCHAIN_VARIANT' and value to 'gnuarmemb'. Click OK to save. -![Adding Zephyr toolchain variable](../assets/env-var/zephyr_toolchain.png) +![Adding Zephyr toolchain variable](assets/env-var/zephyr_toolchain.png) 5. Create another variable with variable name 'GNUARMEMB_TOOLCHAIN_PATH' and value set to wherever you installed your toolchain. **Make sure this path does not contain any spaces.** If it does, rename the folder and update here. Click OK to save. -![Adding GNUARMEMB variable](../assets/env-var/gnuarmemb.png) +![Adding GNUARMEMB variable](assets/env-var/gnuarmemb.png) 6. Close Command Prompt and reopen, or run `refreshenv` to apply the changes. diff --git a/docs/docs/development/tests.md b/docs/docs/dev-tests.md similarity index 82% rename from docs/docs/development/tests.md rename to docs/docs/dev-tests.md index 9ad689b6..d44c4a09 100644 --- a/docs/docs/development/tests.md +++ b/docs/docs/dev-tests.md @@ -1,12 +1,11 @@ --- +id: dev-tests title: Tests sidebar_label: Tests --- -Running tests requires [native posix support](posix-board). Any folder under `/app/tests` -containing `native_posix.keymap` will be selected when running `west test`. - -Run a single test with `west test `, like `west test tests/toggle-layer/normal`. +Running tests requires [native posix support](./dev-posix-board). Any folder under `/app/tests` +containing `native_posix.keymap` will be selected when running `./run-test.sh all`. ## Creating a New Test Set diff --git a/docs/docs/faq.md b/docs/docs/faq.md index 7417a49a..5a73110b 100644 --- a/docs/docs/faq.md +++ b/docs/docs/faq.md @@ -1,4 +1,5 @@ --- +id: faq title: FAQs sidebar_label: FAQs --- @@ -76,10 +77,6 @@ Therefore in ZMK, [board](#what-is-a-board) and [shield](#what-is-a-shield) are Please note, many keyboards only have a single PCB which includes the β€œbrains” (MCU) onboard. In ZMK, these have no [shield](#what-is-a-shield), only a [board](#what-is-a-board). -### Does ZMK support wired split? - -Currently, ZMK only supports wireless split, but wired split is possible and we welcome contributions! - ### What bootloader does ZMK use? ZMK isn’t designed for any particular bootloader, and supports flashing different boards with different flash utilities (e.g. OpenOCD, nrfjprog, etc.). So if you have any difficulties, please let us know on [Discord](https://zmkfirmware.dev/community/discord/invite)! diff --git a/docs/docs/features/displays.md b/docs/docs/feature/displays.md similarity index 100% rename from docs/docs/features/displays.md rename to docs/docs/feature/displays.md diff --git a/docs/docs/features/encoders.md b/docs/docs/feature/encoders.md similarity index 88% rename from docs/docs/features/encoders.md rename to docs/docs/feature/encoders.md index 01610775..b78f89e3 100644 --- a/docs/docs/features/encoders.md +++ b/docs/docs/feature/encoders.md @@ -25,7 +25,7 @@ Rotation is handled separately as a type of sensor. The behavior for this is set sensor-bindings = ; ``` -- `BINDING`, for now, has only one behavior available; `&inc_dec_kp` for key presses (see [Key Press](/docs/behaviors/key-press) for details on available keycodes). +- `BINDING`, for now, has only one behavior available; `&inc_dec_kp` for key presses (see [Key Press](/docs/behavior/key-press) for details on available keycodes). - `CW_KEY` is the keycode activated by a clockwise turn. - `CCW_KEY` is the keycode activated by a counter-clockwise turn. @@ -41,4 +41,4 @@ Here, the left encoder is configured to control volume up and down while the rig ## Adding Encoder Support -See the [New Keyboard Shield](../development/new-shield#encoders) documentation for how to add or modify additional encoders to your shield. +See the [New Keyboard Shield](/docs/dev-guide-new-shield#encoders) documentation for how to add or modify additional encoders to your shield. diff --git a/docs/docs/features/keymaps.md b/docs/docs/feature/keymaps.md similarity index 64% rename from docs/docs/features/keymaps.md rename to docs/docs/feature/keymaps.md index de1f24ac..203b9408 100644 --- a/docs/docs/features/keymaps.md +++ b/docs/docs/feature/keymaps.md @@ -1,11 +1,9 @@ --- +id: keymaps title: Keymaps & Behaviors sidebar_label: Keymaps --- -import KeymapExample from '../keymap-example.md'; -import KeymapExampleFile from '../keymap-example-file.md'; - ZMK uses a declarative approach to keymaps instead of using C code for all keymap configuration. Right now, ZMK uses the devicetree syntax to declare those keymaps; future work is envisioned for supporting dynamic loading of declarative keymaps, e.g. over USB Mass Storage or via a custom BLE @@ -33,7 +31,7 @@ For example, the simplest behavior in ZMK is the "key press" behavior, which res (a certain spot on the keyboard), and when that position is pressed, send a keycode to the host, and when the key position is released, updates the host to notify of the keycode being released. -For the full set of possible behaviors, start at the [Key Press](/docs/behaviors/key-press) behavior. +For the full set of possible behaviors, start at the [Key Press](/docs/behavior/key-press) behavior. ## Layers @@ -124,17 +122,62 @@ Nested under the devicetree root, is the keymap node. The node _name_ itself is Each layer of your keymap will be nested under the keymap node. Here is a sample that defines just one layer for this keymap: - +``` + keymap { + compatible = "zmk,keymap"; + + default_layer { +// -------------------------------------------------------------------------------------------------------------------------------------------------------------------- +// | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ | +// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | +// | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | L SHIFT | L SHIFT | N | M | , | . | / | R CTRL | +// | GUI | DEL | RETURN | SPACE | ESCAPE | | RETURN | SPACE | TAB | BSPC | R ALT | + bindings = < + &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH + &kp TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp QUOTE + &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp LSHFT &kp LSHFT &kp LSHFT &kp LSHFT &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RCTRL + &kp LGUI &kp DEL &kp RET &kp SPACE &kp ESC &kp RET &kp SPACE &kp TAB &kp BSPC &kp RALT + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + }; +``` Each layer should have: 1. A `bindings` property this will be a list of behaviour bindings, one for each key position for the keyboard. 1. (Optional) A `sensor-bindings` property that will be a list of behavior bindings for each sensor on the keyboard. (Currently, only encoders are supported as sensor hardware, but in the future devices like trackpoints would be supported the same way) -For the full set of possible behaviors, start at the [Key Press](/docs/behaviors/key-press) behavior. +For the full set of possible behaviors, start at the [Key Press](/docs/behavior/key-press) behavior. ### Complete Example Putting this all together, a complete [`kyria.keymap`](https://github.com/zmkfirmware/zmk/blob/main/app/boards/shields/kyria/kyria.keymap) looks like: - +``` +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { +// -------------------------------------------------------------------------------------------------------------------------------------------------------------------- +// | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ | +// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | +// | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | L SHIFT | L SHIFT | N | M | , | . | / | R CTRL | +// | GUI | DEL | RETURN | SPACE | ESCAPE | | RETURN | SPACE | TAB | BSPC | R ALT | + bindings = < + &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH + &kp TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp QUOTE + &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp LSHFT &kp LSHFT &kp LSHFT &kp LSHFT &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RCTRL + &kp LGUI &kp DEL &kp RET &kp SPACE &kp ESC &kp RET &kp SPACE &kp TAB &kp BSPC &kp RALT + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + }; +}; +``` diff --git a/docs/docs/features/underglow.md b/docs/docs/feature/underglow.md similarity index 72% rename from docs/docs/features/underglow.md rename to docs/docs/feature/underglow.md index 3692a6de..5e7db0b9 100644 --- a/docs/docs/features/underglow.md +++ b/docs/docs/feature/underglow.md @@ -21,7 +21,7 @@ Here you can see the RGB underglow feature in action using WS2812 LEDs. ## Enabling RGB Underglow -To enable RGB underglow on your board or shield, simply enable the `CONFIG_ZMK_RGB_UNDERGLOW` and `X_STRIP` configuration values in the `.conf` file of your user config directory as such: +To enable RGB underglow on your board or shield, simply enable the `ZMK_RGB_UNDERGLOW` and `X_STRIP` configuration values in the `.conf` file of your user config directory as such: ``` CONFIG_ZMK_RGB_UNDERGLOW=y @@ -35,18 +35,17 @@ If your board or shield does not have RGB underglow configured, refer to [Adding There are various Kconfig options used to configure the RGB underglow feature. These can all be set in the `.conf` file. -| Option | Description | Default | -| ------------------------------------ | ----------------------------------------------- | ------- | -| `CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER` | Underglow toggling also controls external power | y | -| `CONFIG_ZMK_RGB_UNDERGLOW_HUE_STEP` | Hue step in degrees of 360 used by RGB actions | 10 | -| `CONFIG_ZMK_RGB_UNDERGLOW_SAT_STEP` | Saturation step in percent used by RGB actions | 10 | -| `CONFIG_ZMK_RGB_UNDERGLOW_BRT_STEP` | Brightness step in percent used by RGB actions | 10 | -| `CONFIG_ZMK_RGB_UNDERGLOW_HUE_START` | Default hue 0-359 in degrees | 0 | -| `CONFIG_ZMK_RGB_UNDERGLOW_SAT_START` | Default saturation 0-100 in percent | 100 | -| `CONFIG_ZMK_RGB_UNDERGLOW_BRT_START` | Default brightness 0-100 in percent | 100 | -| `CONFIG_ZMK_RGB_UNDERGLOW_SPD_START` | Default effect speed 1-5 | 3 | -| `CONFIG_ZMK_RGB_UNDERGLOW_EFF_START` | Default effect integer from the effect enum | 0 | -| `CONFIG_ZMK_RGB_UNDERGLOW_ON_START` | Default on state | y | +| Option | Description | Default | +| ----------------------------- | ---------------------------------------------- | ------- | +| `ZMK_RGB_UNDERGLOW_HUE_STEP` | Hue step in degrees of 360 used by RGB actions | 10 | +| `ZMK_RGB_UNDERGLOW_SAT_STEP` | Saturation step in percent used by RGB actions | 10 | +| `ZMK_RGB_UNDERGLOW_BRT_STEP` | Brightness step in percent used by RGB actions | 10 | +| `ZMK_RGB_UNDERGLOW_HUE_START` | Default hue 0-359 in degrees | 0 | +| `ZMK_RGB_UNDERGLOW_SAT_START` | Default saturation 0-100 in percent | 100 | +| `ZMK_RGB_UNDERGLOW_BRT_START` | Default brightness 0-100 in percent | 100 | +| `ZMK_RGB_UNDERGLOW_SPD_START` | Default effect speed 1-5 | 3 | +| `ZMK_RGB_UNDERGLOW_EFF_START` | Default effect integer from the effect enum | 0 | +| `ZMK_RGB_UNDERGLOW_ON_START` | Default on state | y | ## Adding RGB Underglow to a Board @@ -62,7 +61,7 @@ Here's an example of an nRF52 SPI definition: ``` &spi1 { - compatible = "nordic,nrf-spim"; + compatible = "nordic,nrf-spi"; status = "okay"; mosi-pin = <6>; // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. @@ -123,7 +122,7 @@ Once you have your `led_strip` properly defined you need to add it to the root d }; ``` -Finally you need to enable the `CONFIG_ZMK_RGB_UNDERGLOW` and `X_STRIP` configuration values in the `.conf` file of your board (or set a default in the `Kconfig.defconfig`): +Finally you need to enable the `ZMK_RGB_UNDERGLOW` and `X_STRIP` configuration values in the `.conf` file of your board (or set a default in the `Kconfig.defconfig`): ``` CONFIG_ZMK_RGB_UNDERGLOW=y diff --git a/docs/docs/hardware.md b/docs/docs/hardware.md index 5cc4980b..54fbff75 100644 --- a/docs/docs/hardware.md +++ b/docs/docs/hardware.md @@ -1,4 +1,5 @@ --- +id: hardware title: Supported Hardware sidebar_label: Supported Hardware --- @@ -27,8 +28,6 @@ That being said, there are currently only a few specific [boards](/docs/faq#what - [Lily58](https://github.com/kata0510/Lily58) (`lily58_left` and `lily58_right`) - [Sofle](https://github.com/josefadamcik/SofleKeyboard) (`sofle_left` and `sofle_right`) - [Splitreus62](https://github.com/Na-Cly/splitreus62) (`splitreus62_left` and `splitreus62_right`) -- [Jorne](https://github.com/joric/jorne) (`jorne_left` and `jorne_right`) -- [Jian](https://github.com/KGOH/Jian-Info) (`jian_left` and `jian_right`) - [Reviung41](https://github.com/gtips/reviung/tree/master/reviung41) (`reviung41`) - [RoMac+ v4](https://www.littlekeyboards.com/products/romac) (`romac_plus`) - [RoMac v2](https://mechboards.co.uk/shop/kits/romac-macro-pad/) (`romac`) @@ -48,4 +47,4 @@ Until detailed documentation is available, feel free to ask questions about how ## Contributing -If you'd like to add support for a new keyboard shield, head over to the [New Keyboard Shield](development/new-shield) documentation. +If you'd like to add support for a new keyboard shield, head over to the [New Keyboard Shield](/docs/dev-guide-new-shield) documentation. diff --git a/docs/docs/intro.md b/docs/docs/intro.md index 564eedb7..8edc3137 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -1,4 +1,5 @@ --- +id: intro title: Introduction to ZMK sidebar_label: Introduction slug: / @@ -11,32 +12,32 @@ firmware built on the [Zephyrβ„’ Project](https://zephyrproject.org/) Real Time ZMK is currently missing some features found in other popular firmware. This table compares the features supported by ZMK, BlueMicro and QMK: -| **Feature** | ZMK | BlueMicro | QMK | -| ------------------------------------------------------------------------------------------------------------------------- | :-: | :-------: | :-: | -| Low Latency BLE Support | βœ… | βœ… | | -| Multi-Device BLE Support | βœ… | | | -| [USB Connectivity](behaviors/outputs) | βœ… | | βœ… | -| User Configuration Repositories | βœ… | | | -| Split Keyboard Support | βœ… | βœ… | βœ… | -| [Keymaps and Layers](behaviors/layers) | βœ… | βœ… | βœ… | -| [Hold-Tap](behaviors/hold-tap) (which includes [Mod-Tap](behaviors/mod-tap) and [Layer-Tap](behaviors/layers/#layer-tap)) | βœ… | βœ… | βœ… | -| [Keyboard Codes](codes/#keyboard) | βœ… | βœ… | βœ… | -| [Media](codes/#media-controls) & [Consumer](codes/#consumer-controls) Codes | βœ… | βœ… | βœ… | -| [Encoders](features/encoders)[^1] | βœ… | | βœ… | -| [OLED Display Support](features/displays)[^2] | 🚧 | 🚧 | βœ… | -| [RGB Underglow](features/underglow) | βœ… | βœ… | βœ… | -| One Shot Keys | 🚧 | βœ… | βœ… | -| Combo Keys | 🚧 | | βœ… | -| Macros | 🚧 | βœ… | βœ… | -| Mouse Keys | | βœ… | βœ… | -| Low Active Power Usage | βœ… | | | -| [Low Power Sleep States](https://github.com/zmkfirmware/zmk/pull/211) | 🚧 | βœ… | | -| [Low Power Mode (VCC Shutoff)](https://github.com/zmkfirmware/zmk/pull/242) | 🚧 | | | -| [Battery Reporting](https://github.com/zmkfirmware/zmk/issues/47) | 🚧 | βœ… | | -| Shell over BLE | | | | -| Realtime Keymap Updating | πŸ’‘ | | βœ… | -| AVR/8 Bit | | | βœ… | -| [Wide Range of ARM Chips Supported](https://docs.zephyrproject.org/latest/boards/index.html) | βœ… | | | +| **Feature** | ZMK | BlueMicro | QMK | +| ---------------------------------------------------------------------------------------------------------------------- | :-: | :-------: | :-: | +| Low Latency BLE Support | βœ… | βœ… | | +| Multi-Device BLE Support | βœ… | | | +| [USB Connectivity](behavior/outputs) | βœ… | | βœ… | +| User Configuration Repositories | βœ… | | | +| Split Keyboard Support | βœ… | βœ… | βœ… | +| [Keymaps and Layers](behavior/layers) | βœ… | βœ… | βœ… | +| [Hold-Tap](behavior/hold-tap) (which includes [Mod-Tap](behavior/mod-tap) and [Layer-Tap](behavior/layers/#layer-tap)) | βœ… | βœ… | βœ… | +| [Keyboard Codes](codes/#keyboard) | βœ… | βœ… | βœ… | +| [Media](codes/#media-controls) & [Consumer](codes/#consumer-controls) Codes | βœ… | βœ… | βœ… | +| [Encoders](feature/encoders)[^1] | βœ… | | βœ… | +| [OLED Display Support](feature/displays)[^2] | 🚧 | 🚧 | βœ… | +| [RGB Underglow](feature/underglow) | βœ… | βœ… | βœ… | +| One Shot Keys | 🚧 | βœ… | βœ… | +| Combo Keys | 🚧 | | βœ… | +| Macros | 🚧 | βœ… | βœ… | +| Mouse Keys | | βœ… | βœ… | +| Low Active Power Usage | βœ… | | | +| [Low Power Sleep States](https://github.com/zmkfirmware/zmk/pull/211) | 🚧 | βœ… | | +| [Low Power Mode (VCC Shutoff)](https://github.com/zmkfirmware/zmk/pull/242) | 🚧 | | | +| [Battery Reporting](https://github.com/zmkfirmware/zmk/issues/47) | 🚧 | βœ… | | +| Shell over BLE | | | | +| Realtime Keymap Updating | πŸ’‘ | | βœ… | +| AVR/8 Bit | | | βœ… | +| [Wide Range of ARM Chips Supported](https://docs.zephyrproject.org/latest/boards/index.html) | βœ… | | | [^2]: Encoders are not currently supported on peripheral side splits. [^1]: OLEDs are currently proof of concept in ZMK. diff --git a/docs/docs/keymap-example-file.md b/docs/docs/keymap-example-file.md deleted file mode 100644 index 5cb9b2f4..00000000 --- a/docs/docs/keymap-example-file.md +++ /dev/null @@ -1,26 +0,0 @@ -``` -#include -#include - -/ { - keymap { - compatible = "zmk,keymap"; - - default_layer { -// -------------------------------------------------------------------------------------------------------------------------------------------------------------------- -// | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ | -// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | -// | SHIFT | Z | X | C | V | B | CTRL+A | CTRL+C | | CTRL+V | CTRL+X | N | M | , | . | / | R CTRL | -// | GUI | DEL | RETURN | SPACE | ESCAPE | | RETURN | SPACE | TAB | BSPC | R ALT | - bindings = < - &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH - &kp TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp QUOTE - &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp LC(A) &kp LC(C) &kp LC(V) &kp LC(X) &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RCTRL - &kp LGUI &kp DEL &kp RET &kp SPACE &kp ESC &kp RET &kp SPACE &kp TAB &kp BSPC &kp RALT - >; - - sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; - }; - }; -}; -``` diff --git a/docs/docs/keymap-example.md b/docs/docs/keymap-example.md deleted file mode 100644 index c6e81d22..00000000 --- a/docs/docs/keymap-example.md +++ /dev/null @@ -1,21 +0,0 @@ -``` - keymap { - compatible = "zmk,keymap"; - - default_layer { -// -------------------------------------------------------------------------------------------------------------------------------------------------------------------- -// | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ | -// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | -// | SHIFT | Z | X | C | V | B | CTRL+A | CTRL+C | | CTRL+V | CTRL+X | N | M | , | . | / | R CTRL | -// | GUI | DEL | RETURN | SPACE | ESCAPE | | RETURN | SPACE | TAB | BSPC | R ALT | - bindings = < - &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH - &kp TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp QUOTE - &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp LC(A) &kp LC(C) &kp LC(V) &kp LC(X) &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RCTRL - &kp LGUI &kp DEL &kp RET &kp SPACE &kp ESC &kp RET &kp SPACE &kp TAB &kp BSPC &kp RALT - >; - - sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; - }; - }; -``` diff --git a/docs/docs/troubleshooting.md b/docs/docs/troubleshooting.md index 0fe0b665..c45cfcce 100644 --- a/docs/docs/troubleshooting.md +++ b/docs/docs/troubleshooting.md @@ -1,4 +1,5 @@ --- +id: troubleshooting title: Troubleshooting sidebar_title: Troubleshooting --- @@ -25,8 +26,23 @@ Variations of the warnings shown below occur when flashing the `.uf2` ### CMake Error -An error along the lines of `CMake Error at (zmk directory)/zephyr/cmake/generic_toolchain.cmake:64 (include): include could not find load file:` during firmware compilation indicates that the Zephyr Environment Variables are not properly defined. -For more information, click [here](../docs/development/setup#environment-variables). +``` +CMake Warning at C:/zmk/zephyr/subsys/usb/CMakeLists.txt:28 (message): + CONFIG_USB_DEVICE_VID has default value 0x2FE3. + + This value is only for testing and MUST be configured for USB products. + + +CMake Warning at C:/zmk/zephyr/subsys/usb/CMakeLists.txt:34 (message): + CONFIG_USB_DEVICE_PID has default value 0x100. + + This value is only for testing and MUST be configured for USB products. +``` + +CMake Warnings shown above during `west build` are normal occurrences. They should not negatively affect the firmware's ability to function as normal. + +On the other hand, an error along the lines of `CMake Error at (zmk directory)/zephyr/cmake/generic_toolchain.cmake:64 (include): include could not find load file:` during firmware compilation indicates that the Zephyr Environment Variables are not properly defined. +For more information, click [here](../docs/dev-setup#environment-variables). ### dtlib.DTError diff --git a/docs/docs/user-setup.md b/docs/docs/user-setup.md index 4a842e41..990a8f6d 100644 --- a/docs/docs/user-setup.md +++ b/docs/docs/user-setup.md @@ -1,4 +1,5 @@ --- +id: user-setup title: Installing ZMK sidebar_label: Installing ZMK --- @@ -82,7 +83,7 @@ bash -c "$(wget https://zmkfirmware.dev/setup.sh -O -)" '' --wget ``` -iex ((New-Object System.Net.WebClient).DownloadString('https://zmkfirmware.dev/setup.ps1')) +iex ((New-Object System.Net.WebClient).DownloadString('https://zmkfirmware.dev/setup.ps1'))" ``` @@ -105,7 +106,7 @@ Pick an MCU board: :::note If you are building firmware for a new keyboard shield that is not included in the built-in list of shields, you can choose any shield from the list that is similar to yours to generate the repository, -and edit / add necessary files according to the [guide for adding new keyboard shield](./development/new-shield). +and edit / add necessary files according to the [guide for adding new keyboard shield](./dev-guide-new-shield.md). ::: When prompted, enter the number for the corresponding keyboard shield you would like to target: @@ -193,7 +194,7 @@ storage device. Once the flash is complete, the controller should automatically ## Wirelessly Connecting Your Keyboard -Connecting your keyboard wirelessly is the same as adding other Bluetooth devides: press the reset button and scan for devices. However, pairing and bonding is still currently being worked on to increase relability and ease of use. In addition, users have in general reported that Bluetooth pairing with computers tends to be quite finnicky. Try out the connection with your tablet or phone first, as those devices seem to work much more consistently. +Connecting your keyboard wirelessly is the same as adding other Bluetooth devides: press the reset button and scan for devices. However, pairing and bonding is still currently being worked on to increase relability and ease of use. In addition, users have in general reported that Bluetooth pairing with computers tends to be quite finnicky. Try out the connection with your tablet or phone first, as those devices seem to work much more consistently. See [BLE Reset](./bond-reset.md) for help on resetting your MCUs if you're experiencing connection issues. ### Connecting Split Keyboard Halves diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 2716039c..97548342 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -45,7 +45,7 @@ module.exports = { }, { label: "Development", - to: "docs/development/setup/", + to: "docs/dev-setup/", }, ], }, diff --git a/docs/sidebars.js b/docs/sidebars.js index 7d124cc6..f05cd056 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -1,5 +1,5 @@ module.exports = { - docs: { + someSidebar: { "Getting Started": [ "intro", "hardware", @@ -9,27 +9,26 @@ module.exports = { "troubleshooting", ], Features: [ - "features/keymaps", - "features/displays", - "features/encoders", - "features/underglow", + "feature/keymaps", + "feature/displays", + "feature/encoders", + "feature/underglow", ], Behaviors: [ - "behaviors/key-press", - "behaviors/layers", - "behaviors/misc", - "behaviors/hold-tap", - "behaviors/mod-tap", - "behaviors/reset", - "behaviors/bluetooth", - "behaviors/outputs", - "behaviors/lighting", - "behaviors/power", + "behavior/key-press", + "behavior/layers", + "behavior/misc", + "behavior/hold-tap", + "behavior/mod-tap", + "behavior/reset", + "behavior/bluetooth", + "behavior/outputs", + "behavior/lighting", + "behavior/power", ], Codes: [ "codes/index", "codes/keyboard-keypad", - "codes/modifiers", "codes/editing", "codes/media", "codes/applications", @@ -37,19 +36,13 @@ module.exports = { "codes/power", ], Development: [ - "development/clean-room", - "development/setup", - "development/build-flash", - "development/boards-shields-keymaps", - "development/posix-board", - "development/tests", - "development/usb-logging", - { - type: "category", - label: "Guides", - collapsed: false, - items: ["development/new-shield"], - }, + "dev-clean-room", + "dev-setup", + "dev-build-flash", + "dev-boards-shields-keymaps", + "dev-posix-board", + "dev-tests", ], + "Dev Guides": ["dev-guide-new-shield", "dev-guide-usb-logging"], }, }; diff --git a/docs/src/components/codes/Table.jsx b/docs/src/components/codes/Table.jsx index 0596de6a..c7dd20c8 100644 --- a/docs/src/components/codes/Table.jsx +++ b/docs/src/components/codes/Table.jsx @@ -19,7 +19,7 @@ function extractFootnoteIds(codes) { new Set( codes .flatMap(({ footnotes }) => Object.values(footnotes)) - .flatMap((refs) => (Array.isArray(refs) ? refs.flat() : refs)) + .map((refs) => (Array.isArray(refs) ? refs.flat() : refs)) ) ); } diff --git a/docs/src/data/hid.js b/docs/src/data/hid.js index d52331f9..1f7daa7c 100644 --- a/docs/src/data/hid.js +++ b/docs/src/data/hid.js @@ -4059,7 +4059,7 @@ export default [ footnotes: {}, }, { - names: ["LEFT_CONTROL", "LCTRL", "LC(code)"], + names: ["LEFT_CONTROL", "LCTRL"], description: "Left Control", context: "Keyboard", clarify: false, @@ -4080,7 +4080,7 @@ export default [ footnotes: {}, }, { - names: ["LEFT_SHIFT", "LSHFT", "LS(code)"], + names: ["LEFT_SHIFT", "LSHFT"], description: "Left Shift ⇧", context: "Keyboard", clarify: false, @@ -4101,7 +4101,7 @@ export default [ footnotes: {}, }, { - names: ["LEFT_ALT", "LALT", "LA(code)"], + names: ["LEFT_ALT", "LALT"], description: "Left Alt", context: "Keyboard", clarify: false, @@ -4125,7 +4125,6 @@ export default [ names: [ "LEFT_GUI", "LGUI", - "LG(code)", "LEFT_WIN", "LWIN", "LEFT_COMMAND", @@ -4153,7 +4152,7 @@ export default [ footnotes: {}, }, { - names: ["RIGHT_CONTROL", "RCTRL", "RC(code)"], + names: ["RIGHT_CONTROL", "RCTRL"], description: "Right Control", context: "Keyboard", clarify: false, @@ -4174,7 +4173,7 @@ export default [ footnotes: {}, }, { - names: ["RIGHT_SHIFT", "RSHFT", "RS(code)"], + names: ["RIGHT_SHIFT", "RSHFT"], description: "Right Shift ⇧", context: "Keyboard", clarify: false, @@ -4195,7 +4194,7 @@ export default [ footnotes: {}, }, { - names: ["RIGHT_ALT", "RALT", "RA(code)"], + names: ["RIGHT_ALT", "RALT"], description: "Right Alt", context: "Keyboard", clarify: false, @@ -4219,7 +4218,6 @@ export default [ names: [ "RIGHT_GUI", "RGUI", - "RG(code)", "RIGHT_WIN", "RWIN", "RIGHT_COMMAND", diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1 index 7c5ce477..4911316b 100644 --- a/docs/static/setup.ps1 +++ b/docs/static/setup.ps1 @@ -1,208 +1,206 @@ -# Copyright (c) 2020 The ZMK Contributors -# -# SPDX-License-Identifier: MIT - -$ErrorActionPreference = "Stop" - -function Get-Choice-From-Options { - param( - [String[]] $Options, - [String] $Prompt - ) - - while ($true) { - for ($i = 0; $i -lt $Options.length; $i++) { - Write-Host "$($i + 1)) $($Options[$i])" - } - - Write-Host "$($Options.length + 1)) Quit" - $selection = (Read-Host $Prompt) -as [int] - - if ($selection -eq $Options.length + 1) { - Write-Host "Goodbye!" - exit 1 - } - elseif ($selection -le $Options.length -and $selection -gt 0) { - $choice = $($selection - 1) - break - } - else { - Write-Host "Invalid Option. Try another one." - } - } - - return $choice -} - -function Test-Git-Config { - param( - [String] $Option, - [String] $ErrMsg - ) - - git config $Option | Out-Null - - if ($lastExitCode -ne 0) { - Write-Host $ErrMsg - exit 1 - } -} - -try { - git | Out-Null -} -catch [System.Management.Automation.CommandNotFoundException] { - Write-Host "Git is not installed, and is required for this script!" - exit 1 -} - -Test-Git-Config -Option "user.name" -ErrMsg "Git username not set!`nRun: git config --global user.name 'My Name'" -Test-Git-Config -Option "user.email" -ErrMsg "Git email not set!`nRun: git config --global user.email 'example@myemail.com'" - -$permission = (Get-Acl $pwd).Access | -?{$_.IdentityReference -match $env:UserName ` - -and $_.FileSystemRights -match "FullControl" ` - -or $_.FileSystemRights -match "Write" } | - - Select IdentityReference,FileSystemRights - -If (-Not $permission){ - Write-Host "Sorry, you do not have write permissions in this directory." - Write-Host "Please try running this script again from a directory that you do have write permissions for." - exit 1 -} - -$repo_path = "https://github.com/zmkfirmware/zmk-config-split-template.git" - -$title = "ZMK Config Setup:" -$prompt = "Pick an MCU board" -$options = "nice!nano", "QMK Proton-C", "BlueMicro840 (v1)", "makerdiary nRF52840 M.2" -$boards = "nice_nano", "proton_c", "bluemicro840_v1", "nrf52840_m2" - -Write-Host "$title" -Write-Host "" -Write-Host "MCU Board Selection:" - -$choice = Get-Choice-From-Options -Options $options -Prompt $prompt -$board = $($boards[$choice]) - -Write-Host "" -Write-Host "Keyboard Shield Selection:" -$prompt = "Pick a keyboard" - -# TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. - -$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "Reviung41", "RoMac", "RoMac+", "makerdiary M60", "Microdox", "TG4X", "QAZ", "NIBBLE", "CRBN", "Jorne", "Jian" -$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "reviung41", "romac", "romac_plus", "m60", "microdox", "tg4x", "qaz", "nibble", "crbn", "jorne", "jian" -$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "n", "y", "n", "n", "n", "n", "y", "y" - - -$choice = Get-Choice-From-Options -Options $options -Prompt $prompt -$shield_title = $($options[$choice]) -$shield = $($names[$choice]) -$split = $($splits[$choice]) - -if ($split -eq "n") { - $repo_path = "https://github.com/zmkfirmware/zmk-config-template.git" -} - -$copy_keymap = Read-Host "Copy in the stock keymap for customisation? [Yn]" - -if ($copy_keymap -eq "" -or $copy_keymap -eq "Y" -or $copy_keymap -eq "y") { - $copy_keymap = "yes" -} - -$github_user = Read-Host "GitHub Username (leave empty to skip GitHub repo creation)" - -if ($github_user -ne "") { - $repo_name = Read-Host "GitHub Repo Name [zmk-config]" - - if ($repo_name -eq "") { - $repo_name = "zmk-config" - } - - $github_repo = Read-Host "GitHub Repo [https://github.com/$github_user/$repo_name.git]" - - if ($github_repo -eq "") { - $github_repo = "https://github.com/$github_user/$repo_name.git" - } -} -else { - $repo_name = "zmk-config" - $github_repo = "" -} - -Write-Host "" -Write-Host "Preparing a user config for:" -Write-Host "* MCU Board: ${board}" -Write-Host "* Shield: ${shield}" - -if ($copy_keymap -eq "yes") { - Write-Host "* Copy Keymap?: Yes" -} -else { - Write-Host "* Copy Keymap?: No" -} - -if ($github_repo -ne "") { - Write-Host "* GitHub Repo to Push (please create this in GH first!): $github_repo" -} - -Write-Host "" -$do_it = Read-Host "Continue? [Yn]" - -if ($do_it -ne "" -and $do_it -ne "Y" -and $do_it -ne "y") { - Write-Host "Aborting..." - exit 1 -} - -git clone --single-branch "$repo_path" "$repo_name" -Set-Location "$repo_name" - -Push-Location config - -Invoke-RestMethod -Uri "https://raw.githubusercontent.com/zmkfirmware/zmk/main/app/boards/shields/${shield}/${shield}.conf" -OutFile "${shield}.conf" - -if ($copy_keymap -eq "yes") { - Invoke-RestMethod -Uri "https://raw.githubusercontent.com/zmkfirmware/zmk/main/app/boards/shields/${shield}/${shield}.keymap" -OutFile "${shield}.keymap" -} - -Pop-Location - -$build_file = (Get-Content .github/workflows/build.yml).replace("BOARD_NAME", $board) -$build_file = $build_file.replace("SHIELD_NAME", $shield) -$build_file = $build_file.replace("KEYBOARD_TITLE", $shield_title) - -if ($board -eq "proton_c") { - $build_file = $build_file.replace("uf2", "hex") -} - -Set-Content -Path .github/workflows/build.yml -Value $build_file - -Remove-Item -Recurse -Force .git -git init . -git add . -git commit -m "Initial User Config." - -if ($github_repo -ne "") { - git remote add origin "$github_repo" - - git push --set-upstream origin $(git symbolic-ref --short HEAD) - - # If push failed, assume that the origin was incorrect and give instructions on fixing. - if ($lastExitCode -ne 0) { - Write-Host "Remote repository $github_repo not found..." - Write-Host "Check GitHub URL, and try adding again." - Write-Host "Run the following: " - Write-Host " git remote rm origin" - Write-Host " git remote add origin FIXED_URL" - Write-Host " git push --set-upstream origin $(git symbolic-ref --short HEAD)" - Write-Host "Once pushed, your firmware should be availalbe from GitHub Actions at: $actions" - exit 1 - } - - if ($github_repo -imatch "https") { - $actions = "$($github_repo.substring(0, $github_repo.length - 4))/actions" - Write-Host "Your firmware should be availalbe from GitHub Actions shortly: $actions" - } -} +# Copyright (c) 2020 The ZMK Contributors +# +# SPDX-License-Identifier: MIT + +$ErrorActionPreference = "Stop" + +function Get-Choice-From-Options { + param( + [String[]] $Options, + [String] $Prompt + ) + + while ($true) { + for ($i = 0; $i -lt $Options.length; $i++) { + Write-Host "$($i + 1)) $($Options[$i])" + } + + Write-Host "$($Options.length + 1)) Quit" + $selection = Read-Host $Prompt + + if ($selection -eq $Options.length + 1) { + Write-Host "Goodbye!" + exit 1 + } + elseif ($selection -le $Options.length) { + $choice = $($selection - 1) + break + } + else { + Write-Host "Invalid Option. Try another one." + } + } + + return $choice +} + +function Test-Git-Config { + param( + [String] $Option, + [String] $ErrMsg + ) + + git config $Option | Out-Null + + if ($lastExitCode -ne 0) { + Write-Host $ErrMsg + exit 1 + } +} + +try { + git | Out-Null +} +catch [System.Management.Automation.CommandNotFoundException] { + Write-Host "Git is not installed, and is required for this script!" + exit 1 +} + +Test-Git-Config -Option "user.name" -ErrMsg "Git username not set!`nRun: git config --global user.name 'My Name'" +Test-Git-Config -Option "user.email" -ErrMsg "Git email not set!`nRun: git config --global user.email 'example@myemail.com'" + +$permission = (Get-Acl $pwd).Access | +?{$_.IdentityReference -match $env:UserName ` + -and $_.FileSystemRights -match "FullControl" ` + -or $_.FileSystemRights -match "Write" } | + + Select IdentityReference,FileSystemRights + +If (-Not $permission){ + Write-Host "Sorry, you do not have write permissions in this directory." + Write-Host "Please try running this script again from a directory that you do have write permissions for." + exit 1 +} + +$repo_path = "https://github.com/zmkfirmware/zmk-config-split-template.git" + +$title = "ZMK Config Setup:" +$prompt = "Pick an MCU board" +$options = "nice!nano", "QMK Proton-C", "BlueMicro840 (v1)", "makerdiary nRF52840 M.2" +$boards = "nice_nano", "proton_c", "bluemicro840_v1", "nrf52840_m2" + +Write-Host "$title" +Write-Host "" +Write-Host "MCU Board Selection:" + +$choice = Get-Choice-From-Options -Options $options -Prompt $prompt +$board = $($boards[$choice]) + +Write-Host "" +Write-Host "Keyboard Shield Selection:" +$prompt = "Pick a keyboard" + +# TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. +$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "Reviung41", "RoMac", "RoMac+", "makerdiary M60", "Microdox", "TG4X", "QAZ", "NIBBLE", "CRBN" +$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "reviung41", "romac", "romac_plus", "m60", "microdox", "tg4x", "qaz", "nibble", "crbn" +$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "n", "y", "n", "n", "n", "n" + +$choice = Get-Choice-From-Options -Options $options -Prompt $prompt +$shield_title = $($options[$choice]) +$shield = $($names[$choice]) +$split = $($splits[$choice]) + +if ($split -eq "n") { + $repo_path = "https://github.com/zmkfirmware/zmk-config-template.git" +} + +$copy_keymap = Read-Host "Copy in the stock keymap for customisation? [Yn]" + +if ($copy_keymap -eq "" -or $copy_keymap -eq "Y" -or $copy_keymap -eq "y") { + $copy_keymap = "yes" +} + +$github_user = Read-Host "GitHub Username (leave empty to skip GitHub repo creation)" + +if ($github_user -ne "") { + $repo_name = Read-Host "GitHub Repo Name [zmk-config]" + + if ($repo_name -eq "") { + $repo_name = "zmk-config" + } + + $github_repo = Read-Host "GitHub Repo [https://github.com/$github_user/$repo_name.git]" + + if ($github_repo -eq "") { + $github_repo = "https://github.com/$github_user/$repo_name.git" + } +} +else { + $repo_name = "zmk-config" + $github_repo = "" +} + +Write-Host "" +Write-Host "Preparing a user config for:" +Write-Host "* MCU Board: ${board}" +Write-Host "* Shield: ${shield}" + +if ($copy_keymap -eq "yes") { + Write-Host "* Copy Keymap?: Yes" +} +else { + Write-Host "* Copy Keymap?: No" +} + +if ($github_repo -ne "") { + Write-Host "* GitHub Repo to Push (please create this in GH first!): $github_repo" +} + +Write-Host "" +$do_it = Read-Host "Continue? [Yn]" + +if ($do_it -ne "" -and $do_it -ne "Y" -and $do_it -ne "y") { + Write-Host "Aborting..." + exit 1 +} + +git clone --single-branch "$repo_path" "$repo_name" +Set-Location "$repo_name" + +Push-Location config + +Invoke-RestMethod -Uri "https://raw.githubusercontent.com/zmkfirmware/zmk/main/app/boards/shields/${shield}/${shield}.conf" -OutFile "${shield}.conf" + +if ($copy_keymap -eq "yes") { + Invoke-RestMethod -Uri "https://raw.githubusercontent.com/zmkfirmware/zmk/main/app/boards/shields/${shield}/${shield}.keymap" -OutFile "${shield}.keymap" +} + +Pop-Location + +$build_file = (Get-Content .github/workflows/build.yml).replace("BOARD_NAME", $board) +$build_file = $build_file.replace("SHIELD_NAME", $shield) +$build_file = $build_file.replace("KEYBOARD_TITLE", $shield_title) + +if ($board -eq "proton_c") { + $build_file = $build_file.replace("uf2", "hex") +} + +Set-Content -Path .github/workflows/build.yml -Value $build_file + +Remove-Item -Recurse -Force .git +git init . +git add . +git commit -m "Initial User Config." + +if ($github_repo -ne "") { + git remote add origin "$github_repo" + + git push --set-upstream origin $(git symbolic-ref --short HEAD) + + # If push failed, assume that the origin was incorrect and give instructions on fixing. + if ($lastExitCode -ne 0) { + Write-Host "Remote repository $github_repo not found..." + Write-Host "Check GitHub URL, and try adding again." + Write-Host "Run the following: " + Write-Host " git remote rm origin" + Write-Host " git remote add origin FIXED_URL" + Write-Host " git push --set-upstream origin $(git symbolic-ref --short HEAD)" + Write-Host "Once pushed, your firmware should be availalbe from GitHub Actions at: $actions" + exit 1 + } + + if ($github_repo -imatch "https") { + $actions = "$($github_repo.substring(0, $github_repo.length - 4))/actions" + Write-Host "Your firmware should be availalbe from GitHub Actions shortly: $actions" + } +} diff --git a/docs/static/setup.sh b/docs/static/setup.sh index 8fd4a3fc..5e8367cf 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -92,7 +92,7 @@ echo "" echo "Keyboard Shield Selection:" prompt="Pick an keyboard:" -options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "Reviung41" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X" "QAZ" "Jorne" "Jian") +options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "Reviung41" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X" "QAZ") PS3="$prompt " # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. @@ -116,9 +116,6 @@ select opt in "${options[@]}" "Quit"; do 13 ) shield_title="QAZ" shield="qaz"; split="n"; break;; 14 ) shield_title="NIBBLE" shield="nibble"; split="n"; break;; 15 ) shield_title="CRBN" shield="crbn"; split="n"; break;; - 16 ) shield_title="Jorne" shield="jorne"; split="y"; break;; - 17 ) shield_title="Jian" shield="jian"; split="y"; break;; - # Add link to docs on adding your own custom shield in your ZMK config! # $(( ${#options[@]}+1 )) ) echo "Other!"; break;;