Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit f8d7011
Author: Nick Brassel <[email protected]>
Date:   Mon Apr 10 11:32:56 2023 +1000

    Fix up via keymap builds. (qmk#20397)

commit 15e5a58
Merge: da1a52a fb706f4
Author: QMK Bot <[email protected]>
Date:   Sun Apr 9 21:38:46 2023 +0000

    Merge remote-tracking branch 'origin/master' into develop

commit fb706f4
Author: Nick Brassel <[email protected]>
Date:   Mon Apr 10 07:38:09 2023 +1000

    Run CI builds for each push, limit queued workflow depth to 1. (qmk#20362)

commit da1a52a
Merge: 6c17277 9132c64
Author: QMK Bot <[email protected]>
Date:   Sun Apr 9 21:33:24 2023 +0000

    Merge remote-tracking branch 'origin/master' into develop

commit 9132c64
Author: Ryan <[email protected]>
Date:   Mon Apr 10 09:32:40 2023 +1200

    Add numpad 0-9 to second layer, update keycodes for QMK 0.17.5, fix layout (qmk#20375)

commit 6c17277
Merge: f5b7491 6e0acf0
Author: QMK Bot <[email protected]>
Date:   Sun Apr 9 16:42:12 2023 +0000

    Merge remote-tracking branch 'origin/master' into develop

commit 6e0acf0
Author: Dasky <[email protected]>
Date:   Sun Apr 9 17:41:30 2023 +0100

    Add autocomplete to generate-compilation-database (qmk#20387)

commit f5b7491
Author: Albert Y <[email protected]>
Date:   Mon Apr 10 00:37:31 2023 +0800

    Add swap hands toggle functions (qmk#20381)

commit 5d6d959
Author: Nick Brassel <[email protected]>
Date:   Sun Apr 9 22:41:32 2023 +1000

    Fix up via keymap builds. (qmk#20383)

    * Fix up via keymap builds.

    - Usages of old IS_PRESSED.

    * Fix up bad code.

    * Fix up bad code.
  • Loading branch information
freznel10 committed Apr 10, 2023
1 parent 6cd877d commit 259e0c8
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 17 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/ci_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ permissions:
contents: read

on:
push:
branches: [master, develop]
workflow_dispatch:
schedule:
- cron: '0 0,12 * * *'
inputs:
branch:
type: choice
description: 'Branch to build'
options: [master, develop]

concurrency: ci_build-${{ github.event.inputs.branch || github.ref_name }}

jobs:
ci_builds:
Expand All @@ -18,7 +25,6 @@ jobs:
strategy:
fail-fast: false
matrix:
branch: [master, develop]
keymap: [default, via]

container: ghcr.io/qmk/qmk_cli
Expand All @@ -30,7 +36,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: recursive
ref: ${{ matrix.branch }}
ref: ${{ github.event.inputs.branch || github.ref }}

- name: Install dependencies
run: pip3 install -r requirements.txt
Expand All @@ -50,7 +56,7 @@ jobs:
uses: actions/upload-artifact@v3
if: always()
with:
name: artifacts-${{ matrix.branch }}-${{ matrix.keymap }}
name: artifacts-${{ github.event.inputs.branch || github.ref_name }}-${{ matrix.keymap }}
if-no-files-found: ignore
path: |
*.bin
Expand All @@ -65,4 +71,4 @@ jobs:
DISCORD_WEBHOOK: ${{ secrets.CI_DISCORD_WEBHOOK }}
run: |
python3 -m pip install -r requirements.txt
python3 ./discord-results.py --branch ${{ matrix.branch }} --keymap ${{ matrix.keymap }} --url ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
python3 ./discord-results.py --branch ${{ github.event.inputs.branch || github.ref_name }} --keymap ${{ matrix.keymap }} --url ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
11 changes: 8 additions & 3 deletions docs/feature_swap_hands.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = { 1, 0 };

### Functions :id=functions

| Function | Description |
|----------------------|---------------------------------------------|
| `is_swap_hands_on()` | Returns true if Swap-Hands is currently on. |
User callback functions to manipulate Swap-Hands:

| Function | Description |
|-----------------------|---------------------------------------------|
| `swap_hands_on()` | Turns Swap-Hands on. |
| `swap_hands_off()` | Turns Swap-Hands off. |
| `swap_hands_toggle()` | Toggles Swap-Hands. |
| `is_swap_hands_on()` | Returns true if Swap-Hands is currently on. |
4 changes: 2 additions & 2 deletions keyboards/custommk/genesis/rev2/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ keyevent_t encoder_left_ccw = {

keyevent_t encoder_left_cw = {
.key = (keypos_t){.row = 5, .col = 1},
.pressed = false
.pressed = false,
.type = KEY_EVENT
};

keyevent_t encoder_right_ccw = {
.key = (keypos_t){.row = 5, .col = 2},
.pressed = false
.pressed = false,
.type = KEY_EVENT
};

Expand Down
20 changes: 17 additions & 3 deletions keyboards/tada68/keymaps/tokyovigilante/keymap.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ansi(KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GRV, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
[1] = LAYOUT_ansi(KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_INS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, BL_DOWN,BL_TOGG, BL_UP, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, MO(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R),
[2] = LAYOUT_ansi(KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, QK_BOOT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO)
[0] = LAYOUT_ansi(QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_GRV,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_HOME, MO(1), KC_END, KC_LEFT, KC_DOWN, KC_RGHT),

[1] = LAYOUT_ansi(KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS,
KC_TRNS, KC_P7, KC_P8, KC_P9, KC_NUM, BL_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME,
KC_TRNS, KC_P4, KC_P5, KC_P6, KC_TRNS, BL_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END,
KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, BL_DOWN, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, MO(2), KC_TRNS, KC_TRNS, KC_RALT, KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT),

[2] = LAYOUT_ansi(KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, QK_BOOT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO)
};
8 changes: 5 additions & 3 deletions lib/python/qmk/cli/generate/compilation_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from qmk.commands import create_make_command
from qmk.constants import QMK_FIRMWARE
from qmk.decorators import automagic_keyboard, automagic_keymap
from qmk.keyboard import keyboard_completer, keyboard_folder
from qmk.keymap import keymap_completer


@lru_cache(maxsize=10)
Expand Down Expand Up @@ -74,8 +76,8 @@ def parse_make_n(f: Iterator[str]) -> List[Dict[str, str]]:
return records


@cli.argument('-kb', '--keyboard', help='The keyboard to build a firmware for. Ignored when a configurator export is supplied.')
@cli.argument('-km', '--keymap', help='The keymap to build a firmware for. Ignored when a configurator export is supplied.')
@cli.argument('-kb', '--keyboard', type=keyboard_folder, completer=keyboard_completer, help='The keyboard\'s name')
@cli.argument('-km', '--keymap', completer=keymap_completer, help='The keymap\'s name')
@cli.subcommand('Create a compilation database.')
@automagic_keyboard
@automagic_keymap
Expand Down Expand Up @@ -104,7 +106,7 @@ def generate_compilation_database(cli: MILC) -> Union[bool, int]:

if not command:
cli.log.error('You must supply both `--keyboard` and `--keymap`, or be in a directory for a keyboard or keymap.')
cli.echo('usage: qmk compiledb [-kb KEYBOARD] [-km KEYMAP]')
cli.echo('usage: qmk generate-compilation-database [-kb KEYBOARD] [-km KEYMAP]')
return False

# remove any environment variable overrides which could trip us up
Expand Down
12 changes: 12 additions & 0 deletions quantum/action.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,18 @@ void set_swap_hands_state(size_t index, uint8_t *swap_state, bool on) {
}
}

void swap_hands_on(void) {
swap_hands = true;
}

void swap_hands_off(void) {
swap_hands = false;
}

void swap_hands_toggle(void) {
swap_hands = !swap_hands;
}

bool is_swap_hands_on(void) {
return swap_hands;
}
Expand Down
13 changes: 13 additions & 0 deletions quantum/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,26 @@ typedef uint32_t swap_state_row_t;
# error "MATRIX_COLS: invalid value"
# endif

/**
* @brief Enable swap hands
*/
void swap_hands_on(void);
/**
* @brief Disable swap hands
*/
void swap_hands_off(void);
/**
* @brief Toggle swap hands enable state
*/
void swap_hands_toggle(void);
/**
* @brief Get the swap hands enable state
*
* @return true
* @return false
*/
bool is_swap_hands_on(void);

void process_hand_swap(keyevent_t *record);
#endif

Expand Down

0 comments on commit 259e0c8

Please sign in to comment.