Skip to content

Add positional hold-trigger regions for Morse behaviors - #1037

Open
colonelpanic8 wants to merge 3 commits into
rmk-rs:mainfrom
colonelpanic8:feat/morse-hold-trigger-on-release
Open

Add positional hold-trigger regions for Morse behaviors#1037
colonelpanic8 wants to merge 3 commits into
rmk-rs:mainfrom
colonelpanic8:feat/morse-hold-trigger-on-release

Conversation

@colonelpanic8

Copy link
Copy Markdown
Contributor

Summary

  • add hold_trigger_key_positions and reusable [layout.regions] aliases to Morse configuration
  • apply positional filtering before the decision mode so excluded same-hand keys resolve the pending Morse key as a tap, including when the new key is itself a modifier
  • add opt-in hold_trigger_on_release for same-hand chording without permitting excluded keys to activate a hold
  • validate region names and coordinates, deduplicate expanded positions, and size generated capacities automatically

This replaces rigid hand-only suppression with layout-defined position sets while preserving existing configurations.

Verification

  • rmk-config: 90 unit tests and 6 integration tests
  • positional simulator scenarios: 5 passed
  • on-release simulator scenarios: 7 passed
  • cargo fmt --all --check
  • cargo clippy -p rmk-config --all-targets -- -D warnings
  • downstream Glove80 left and right firmware builds

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

Size Report

Example main PR Diff .text .data .bss
use_config/nrf52832_ble 398.4 KiB 400.1 KiB +0.43% ⬆️ +1716 0 +48
use_config/nrf52840_ble 440.6 KiB 442.4 KiB +0.40% ⬆️ +1772 0 +48
use_config/nrf52840_ble_split (central) 502.5 KiB 503.8 KiB +0.24% ⬆️ +1220 0 +48
use_config/nrf52840_ble_split (peripheral) 317.5 KiB 318.4 KiB +0.28% ⬆️ +916 0 0
use_config/pi_pico_w_ble 673.3 KiB 675.1 KiB +0.26% ⬆️ +1780 0 +48
use_config/rp2040 146.1 KiB 148.0 KiB +1.30% ⬆️ +1904 0 +48
use_config/rp2040_split (central) 159.7 KiB 161.6 KiB +1.18% ⬆️ +1892 0 +48
use_config/rp2040_split (peripheral) 27.9 KiB 27.9 KiB +0.00% 0 0 0
use_config/stm32f1 62.7 KiB 63.0 KiB +0.49% ⬆️ +268 0 +48
use_config/stm32h7 100.9 KiB 101.2 KiB +0.33% ⬆️ +296 0 +48
use_rust/nrf52832_ble 385.7 KiB 387.1 KiB +0.36% ⬆️ +1392 0 +48
use_rust/nrf52840_ble 436.1 KiB 437.8 KiB +0.41% ⬆️ +1788 0 +48
use_rust/nrf52840_ble_split (central) 505.8 KiB 507.4 KiB +0.32% ⬆️ +1612 0 +48
use_rust/nrf52840_ble_split (peripheral) 315.3 KiB 316.2 KiB +0.27% ⬆️ +880 0 0
use_rust/pi_pico_w_ble 672.6 KiB 674.4 KiB +0.26% ⬆️ +1744 0 +48
use_rust/rp2040 145.5 KiB 147.4 KiB +1.28% ⬆️ +1872 0 +48
use_rust/rp2040_split (central) 158.4 KiB 160.4 KiB +1.24% ⬆️ +1964 0 +48
use_rust/rp2040_split (peripheral) 28.2 KiB 28.2 KiB +0.00% 0 0 0
use_rust/stm32f1 61.9 KiB 62.3 KiB +0.51% ⬆️ +276 0 +48
use_rust/stm32h7 119.3 KiB 120.8 KiB +1.30% ⬆️ +1540 0 +48
use_config/nrf52832_ble — 398.4 KiB → 400.1 KiB (+0.43% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 367392	   8620	  33728	 409740	  6408c	rmk-nrf52832

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 365676	   8620	  33680	 407976	  639a8	rmk-nrf52832

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.5% +19.0Ki  [ = ]       0    .debug_str
  +0.6% +11.4Ki  [ = ]       0    .debug_info
  +0.9% +5.93Ki  [ = ]       0    .debug_loc
  +0.7% +2.29Ki  [ = ]       0    .debug_line
  +0.6% +1.88Ki  [ = ]       0    .strtab
  +0.5% +1.64Ki  +0.5% +1.64Ki    .text
  +0.5% +1.02Ki  [ = ]       0    .debug_ranges
  +0.5%    +656  [ = ]       0    .symtab
  +0.8%    +360  [ = ]       0    .debug_frame
  +0.4%    +168  [ = ]       0    .debug_aranges
  [ = ]       0  +0.1%     +48    .bss
  +0.1%     +32  +0.1%     +32    .rodata
  +0.2%     +16  [ = ]       0    .debug_abbrev
   +30%     +16  [ = ]       0    [Unmapped]
  +0.9%      +8  [ = ]       0    .defmt
  +0.6% +44.4Ki  +0.4% +1.72Ki    TOTAL
use_config/nrf52840_ble — 440.6 KiB → 442.4 KiB (+0.40% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 400632	   8628	  43760	 453020	  6e99c	rmk-nrf52840

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 398860	   8628	  43712	 451200	  6e280	rmk-nrf52840

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.4% +17.4Ki  [ = ]       0    .debug_str
  +0.6% +11.8Ki  [ = ]       0    .debug_info
  +0.8% +5.96Ki  [ = ]       0    .debug_loc
  +0.5% +1.80Ki  [ = ]       0    .debug_line
  +0.5% +1.70Ki  +0.5% +1.70Ki    .text
  +0.4% +1.45Ki  [ = ]       0    .strtab
  +0.4%    +848  [ = ]       0    .debug_ranges
  +0.4%    +560  [ = ]       0    .symtab
  +0.6%    +280  [ = ]       0    .debug_frame
  +0.3%    +128  [ = ]       0    .debug_aranges
  [ = ]       0  +0.1%     +48    .bss
  +0.1%     +32  +0.1%     +32    .rodata
   +40%     +20  [ = ]       0    [Unmapped]
  +0.9%      +8  [ = ]       0    .defmt
  +0.5% +42.0Ki  +0.4% +1.78Ki    TOTAL
use_config/nrf52840_ble_split (central) — 502.5 KiB → 503.8 KiB (+0.24% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 458056	   8684	  49104	 515844	  7df04	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 456836	   8684	  49056	 514576	  7da10	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.3% +12.8Ki  [ = ]       0    .debug_str
  +0.5% +12.3Ki  [ = ]       0    .debug_info
  +0.5% +3.79Ki  [ = ]       0    .debug_loc
  +0.5% +1.79Ki  [ = ]       0    .debug_line
  +0.3% +1.17Ki  +0.3% +1.17Ki    .text
  +0.2%    +984  [ = ]       0    .strtab
  +0.4%    +960  [ = ]       0    .debug_ranges
  +0.4%    +656  [ = ]       0    .symtab
  +0.6%    +344  [ = ]       0    .debug_frame
  +0.3%    +160  [ = ]       0    .debug_aranges
  [ = ]       0  +0.1%     +48    .bss
  +0.1%     +24  +0.1%     +24    .rodata
  -9.1%      -6  [ = ]       0    [Unmapped]
  +0.4% +34.9Ki  +0.2% +1.24Ki    TOTAL
use_config/nrf52840_ble_split (peripheral) — 317.5 KiB → 318.4 KiB (+0.28% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 292380	   8500	  25184	 326064	  4f9b0	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 291464	   8500	  25184	 325148	  4f61c	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.5% +15.9Ki  [ = ]       0    .debug_str
  +0.5% +8.57Ki  [ = ]       0    .debug_info
  +0.5% +1.17Ki  [ = ]       0    .debug_line
  +0.2%    +946  [ = ]       0    .debug_loc
  +0.4%    +908  +0.4%    +908    .text
  +0.5%    +792  [ = ]       0    .debug_ranges
  +0.2%    +536  [ = ]       0    .strtab
  +0.2%    +208  [ = ]       0    .symtab
  +0.4%    +132  [ = ]       0    .debug_frame
  +0.2%     +80  [ = ]       0    .debug_aranges
   +27%     +13  [ = ]       0    [Unmapped]
  +0.0%      +8  +0.0%      +8    .rodata
  +0.4% +29.2Ki  +0.3%    +916    TOTAL
use_config/pi_pico_w_ble — 673.3 KiB → 675.1 KiB (+0.26% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 637496	      0	  53792	 691288	  a8c58	rmk-pi-pico-w

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 635716	      0	  53744	 689460	  a8534	rmk-pi-pico-w

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.4% +16.3Ki  [ = ]       0    .debug_str
  +0.5% +11.2Ki  [ = ]       0    .debug_info
  +0.5% +5.25Ki  [ = ]       0    .debug_loc
  +0.5% +1.71Ki  +0.5% +1.71Ki    .text
  +0.4% +1.60Ki  [ = ]       0    .debug_line
  +0.5% +1.31Ki  [ = ]       0    .debug_ranges
  +0.4% +1.30Ki  [ = ]       0    .strtab
  +0.5%    +432  [ = ]       0    .symtab
  +0.3%    +132  [ = ]       0    .debug_frame
  +0.1%     +56  [ = ]       0    .debug_aranges
  [ = ]       0  +0.1%     +48    .bss
  +0.0%     +28  +0.0%     +28    .rodata
   +24%     +11  [ = ]       0    [Unmapped]
  -0.4%     -39  [ = ]       0    .debug_abbrev
  +0.4% +39.3Ki  +0.3% +1.79Ki    TOTAL
use_config/rp2040 — 146.1 KiB → 148.0 KiB (+1.30% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 137576	      0	  13948	 151524	  24fe4	rmk-rp2040

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 135672	      0	  13900	 149572	  24844	rmk-rp2040

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +1.1% +17.8Ki  [ = ]       0    .debug_str
  +1.2% +11.8Ki  [ = ]       0    .debug_info
  +1.3% +4.07Ki  [ = ]       0    .debug_loc
  +1.2% +2.00Ki  [ = ]       0    .debug_line
  +1.6% +1.83Ki  +1.6% +1.83Ki    .text
  +1.1% +1.31Ki  [ = ]       0    .strtab
  +0.9%    +776  [ = ]       0    .debug_ranges
  +1.0%    +336  [ = ]       0    .symtab
  +0.8%    +132  [ = ]       0    .debug_frame
  +0.3%     +56  [ = ]       0    .debug_aranges
  [ = ]       0  +0.4%     +48    .bss
  +0.2%     +28  +0.2%     +28    .rodata
  +1.9%      +8  [ = ]       0    .defmt
 -26.8%     -15  [ = ]       0    [Unmapped]
  +1.1% +40.1Ki  +1.3% +1.91Ki    TOTAL
use_config/rp2040_split (central) — 159.7 KiB → 161.6 KiB (+1.18% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 150608	      0	  14892	 165500	  2867c	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 148716	      0	  14844	 163560	  27ee8	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.9% +17.5Ki  [ = ]       0    .debug_str
  +1.0% +11.7Ki  [ = ]       0    .debug_info
  +1.5% +5.26Ki  [ = ]       0    .debug_loc
  +1.1% +2.00Ki  [ = ]       0    .debug_line
  +1.4% +1.82Ki  +1.4% +1.82Ki    .text
  +1.0% +1.32Ki  [ = ]       0    .strtab
  +0.7%    +656  [ = ]       0    .debug_ranges
  +1.4%    +496  [ = ]       0    .symtab
  +0.7%    +132  [ = ]       0    .debug_frame
  +0.3%     +56  [ = ]       0    .debug_aranges
  [ = ]       0  +0.3%     +48    .bss
  +0.2%     +28  +0.2%     +28    .rodata
   +67%     +26  [ = ]       0    [Unmapped]
  +1.0% +40.9Ki  +1.2% +1.89Ki    TOTAL
use_config/rp2040_split (peripheral) — 27.9 KiB → 27.9 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  25696	     60	   2804	  28560	   6f90	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  25696	     60	   2804	  28560	   6f90	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1%    +923  [ = ]       0    .debug_str
  +0.1%    +387  [ = ]       0    .debug_info
  +0.2%     +24  [ = ]       0    .debug_aranges
  -0.0%      -1  [ = ]       0    .strtab
  -2.0%      -1  [ = ]       0    [Unmapped]
  +0.1% +1.30Ki  [ = ]       0    TOTAL
use_config/stm32f1 — 62.7 KiB → 63.0 KiB (+0.49% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  58056	     28	   6408	  64492	   fbec	rmk-stm32f1

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  57788	     28	   6360	  64176	   fab0	rmk-stm32f1

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.5% +2.95Ki  [ = ]       0    .debug_info
  +0.3% +2.62Ki  [ = ]       0    .debug_str
  +0.6%    +733  [ = ]       0    .debug_loc
  +0.4%    +388  [ = ]       0    .debug_line
  +0.5%    +268  +0.5%    +268    .text
  +0.4%    +203  [ = ]       0    .strtab
  +0.5%     +96  [ = ]       0    .symtab
  +0.7%     +88  [ = ]       0    .debug_frame
  [ = ]       0  +0.8%     +48    .bss
  +0.1%     +40  [ = ]       0    .debug_ranges
  +0.4%     +24  [ = ]       0    .debug_aranges
 -29.3%     -17  [ = ]       0    [Unmapped]
  +0.4% +7.35Ki  +0.5%    +316    TOTAL
use_config/stm32h7 — 100.9 KiB → 101.2 KiB (+0.33% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  95200	    264	   8160	 103624	  194c8	rmk-stm32h7

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  94904	    264	   8112	 103280	  19370	rmk-stm32h7

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.3% +2.68Ki  [ = ]       0    .debug_info
  +0.1% +2.49Ki  [ = ]       0    .debug_str
  +0.3%    +347  [ = ]       0    .debug_line
  +0.3%    +280  +0.3%    +280    .text
  +0.3%    +194  [ = ]       0    .strtab
  +0.5%    +144  [ = ]       0    .symtab
  +0.6%     +88  [ = ]       0    .debug_frame
  +0.1%     +64  [ = ]       0    .debug_ranges
  [ = ]       0  +0.6%     +48    .bss
  +0.1%     +24  [ = ]       0    .debug_aranges
  +0.1%     +16  +0.1%     +16    .rodata
  +0.0%      +1  [ = ]       0    .debug_loc
 -24.0%     -12  [ = ]       0    [Unmapped]
  +0.2% +6.29Ki  +0.3%    +344    TOTAL
use_rust/nrf52832_ble — 385.7 KiB → 387.1 KiB (+0.36% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 354144	   8620	  33672	 396436	  60c94	rmk-nrf52832

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 352752	   8620	  33624	 394996	  606f4	rmk-nrf52832

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.4% +14.9Ki  [ = ]       0    .debug_str
  +0.5% +10.0Ki  [ = ]       0    .debug_info
  +0.8% +5.18Ki  [ = ]       0    .debug_loc
  +0.5% +1.36Ki  [ = ]       0    .debug_line
  +0.4% +1.34Ki  +0.4% +1.34Ki    .text
  +0.5%   +1008  [ = ]       0    .debug_ranges
  +0.2%    +678  [ = ]       0    .strtab
  +0.2%    +272  [ = ]       0    .symtab
  +0.5%    +200  [ = ]       0    .debug_frame
  +0.2%     +64  [ = ]       0    .debug_aranges
  [ = ]       0  +0.1%     +48    .bss
  +0.1%     +24  +0.1%     +24    .rodata
   +42%     +20  [ = ]       0    [Unmapped]
  +0.5% +35.0Ki  +0.4% +1.41Ki    TOTAL
use_rust/nrf52840_ble — 436.1 KiB → 437.8 KiB (+0.41% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 398736	   8628	  40992	 448356	  6d764	rmk-nrf52840

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 396948	   8628	  40944	 446520	  6d038	rmk-nrf52840

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.5% +21.7Ki  [ = ]       0    .debug_str
  +0.5% +11.5Ki  [ = ]       0    .debug_info
  +0.8% +5.85Ki  [ = ]       0    .debug_loc
  +0.6% +2.04Ki  [ = ]       0    .strtab
  +0.5% +1.72Ki  +0.5% +1.72Ki    .text
  +0.5% +1.64Ki  [ = ]       0    .debug_line
  +0.5% +1.05Ki  [ = ]       0    .debug_ranges
  +0.5%    +688  [ = ]       0    .symtab
  +0.7%    +360  [ = ]       0    .debug_frame
  +0.4%    +168  [ = ]       0    .debug_aranges
  [ = ]       0  +0.1%     +48    .bss
  +0.1%     +24  +0.1%     +24    .rodata
 -35.6%     -26  [ = ]       0    [Unmapped]
  +0.6% +46.7Ki  +0.4% +1.79Ki    TOTAL
use_rust/nrf52840_ble_split (central) — 505.8 KiB → 507.4 KiB (+0.32% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 459872	   8684	  51056	 519612	  7edbc	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 458260	   8684	  51008	 517952	  7e740	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.3% +16.6Ki  [ = ]       0    .debug_str
  +0.5% +11.0Ki  [ = ]       0    .debug_info
  +0.6% +5.15Ki  [ = ]       0    .debug_loc
  +0.8% +2.12Ki  [ = ]       0    .debug_ranges
  +0.5% +1.86Ki  [ = ]       0    .debug_line
  +0.4% +1.57Ki  [ = ]       0    .strtab
  +0.4% +1.55Ki  +0.4% +1.55Ki    .text
  +0.5%    +752  [ = ]       0    .symtab
  +0.7%    +376  [ = ]       0    .debug_frame
  +0.4%    +176  [ = ]       0    .debug_aranges
  [ = ]       0  +0.1%     +48    .bss
  +0.1%     +24  +0.1%     +24    .rodata
  +0.2%     +19  [ = ]       0    .debug_abbrev
   +38%     +19  [ = ]       0    [Unmapped]
  +0.9%      +8  [ = ]       0    .defmt
  +0.4% +41.2Ki  +0.3% +1.62Ki    TOTAL
use_rust/nrf52840_ble_split (peripheral) — 315.3 KiB → 316.2 KiB (+0.27% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 290332	   8500	  24952	 323784	  4f0c8	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 289452	   8500	  24952	 322904	  4ed58	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.5% +16.0Ki  [ = ]       0    .debug_str
  +0.6% +8.77Ki  [ = ]       0    .debug_info
  +0.5% +2.66Ki  [ = ]       0    .debug_loc
  +0.5% +1.09Ki  [ = ]       0    .debug_line
  +0.3%    +872  +0.3%    +872    .text
  +0.4%    +648  [ = ]       0    .debug_ranges
  +0.2%    +630  [ = ]       0    .strtab
  +0.4%    +400  [ = ]       0    .symtab
  +0.6%    +196  [ = ]       0    .debug_frame
  +0.3%    +112  [ = ]       0    .debug_aranges
   +32%     +16  [ = ]       0    [Unmapped]
  +0.0%      +8  +0.0%      +8    .rodata
  +0.5% +31.3Ki  +0.3%    +880    TOTAL
use_rust/pi_pico_w_ble — 672.6 KiB → 674.4 KiB (+0.26% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 637080	      0	  53472	 690552	  a8978	rmk-pi-pico-w

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 635336	      0	  53424	 688760	  a8278	rmk-pi-pico-w

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.3% +11.8Ki  [ = ]       0    .debug_str
  +0.5% +11.5Ki  [ = ]       0    .debug_info
  +0.4% +4.86Ki  [ = ]       0    .debug_loc
  +0.4% +1.76Ki  [ = ]       0    .debug_line
  +0.5% +1.68Ki  +0.5% +1.68Ki    .text
  +0.4%    +984  [ = ]       0    .debug_ranges
  +0.2%    +677  [ = ]       0    .strtab
  +0.4%    +304  [ = ]       0    .symtab
  +0.3%    +132  [ = ]       0    .debug_frame
  +0.1%     +56  [ = ]       0    .debug_aranges
  [ = ]       0  +0.1%     +48    .bss
  +0.0%     +28  +0.0%     +28    .rodata
   +62%     +23  [ = ]       0    [Unmapped]
  +0.4% +33.8Ki  +0.3% +1.75Ki    TOTAL
use_rust/rp2040 — 145.5 KiB → 147.4 KiB (+1.28% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 137172	      0	  13780	 150952	  24da8	rmk-rp2040

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 135300	      0	  13732	 149032	  24628	rmk-rp2040

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +1.2% +19.2Ki  [ = ]       0    .debug_str
  +1.2% +12.1Ki  [ = ]       0    .debug_info
  +1.5% +4.57Ki  [ = ]       0    .debug_loc
  +1.3% +2.09Ki  [ = ]       0    .debug_line
  +1.6% +1.80Ki  +1.6% +1.80Ki    .text
  +1.1% +1.33Ki  [ = ]       0    .strtab
  +0.9%    +768  [ = ]       0    .debug_ranges
  +1.2%    +400  [ = ]       0    .symtab
  +0.8%    +132  [ = ]       0    .debug_frame
  +0.3%     +56  [ = ]       0    .debug_aranges
  [ = ]       0  +0.4%     +48    .bss
  +0.2%     +28  +0.2%     +28    .rodata
   +38%     +17  [ = ]       0    [Unmapped]
  +1.9%      +8  [ = ]       0    .defmt
  +1.2% +42.5Ki  +1.3% +1.88Ki    TOTAL
use_rust/rp2040_split (central) — 158.4 KiB → 160.4 KiB (+1.24% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 149584	      0	  14636	 164220	  2817c	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 147620	      0	  14588	 162208	  279a0	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.9% +18.7Ki  [ = ]       0    .debug_str
  +1.0% +11.3Ki  [ = ]       0    .debug_info
  +1.3% +4.54Ki  [ = ]       0    .debug_loc
  +1.5% +1.89Ki  +1.5% +1.89Ki    .text
  +1.0% +1.72Ki  [ = ]       0    .debug_line
  +1.2% +1.57Ki  [ = ]       0    .strtab
  +0.6%    +584  [ = ]       0    .debug_ranges
  +1.0%    +368  [ = ]       0    .symtab
  +0.7%    +132  [ = ]       0    .debug_frame
  +0.3%     +56  [ = ]       0    .debug_aranges
  [ = ]       0  +0.4%     +48    .bss
  +0.2%     +28  +0.2%     +28    .rodata
   +50%     +22  [ = ]       0    [Unmapped]
  +1.8%      +8  [ = ]       0    .defmt
  +1.0% +41.0Ki  +1.2% +1.96Ki    TOTAL
use_rust/rp2040_split (peripheral) — 28.2 KiB → 28.2 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  25796	     60	   3068	  28924	   70fc	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  25796	     60	   3068	  28924	   70fc	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.2% +1.47Ki  [ = ]       0    .debug_str
  +0.1%    +387  [ = ]       0    .debug_info
  +0.1%     +27  [ = ]       0    .strtab
  +0.2%     +24  [ = ]       0    .debug_aranges
  +2.0%      +1  [ = ]       0    [Unmapped]
  +0.1% +1.90Ki  [ = ]       0    TOTAL
use_rust/stm32f1 — 61.9 KiB → 62.3 KiB (+0.51% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  57396	     28	   6328	  63752	   f908	rmk-stm32f1

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  57120	     28	   6280	  63428	   f7c4	rmk-stm32f1

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.5% +2.88Ki  [ = ]       0    .debug_info
  +0.3% +2.56Ki  [ = ]       0    .debug_str
  +0.5%    +706  [ = ]       0    .debug_loc
  +0.4%    +383  [ = ]       0    .debug_line
  +0.5%    +276  +0.5%    +276    .text
  +0.4%    +194  [ = ]       0    .strtab
  +0.5%     +96  [ = ]       0    .symtab
  +0.7%     +88  [ = ]       0    .debug_frame
  [ = ]       0  +0.8%     +48    .bss
  +0.1%     +40  [ = ]       0    .debug_ranges
  +0.5%     +24  [ = ]       0    .debug_aranges
   +27%     +14  [ = ]       0    [Unmapped]
  +0.4% +7.21Ki  +0.5%    +324    TOTAL
use_rust/stm32h7 — 119.3 KiB → 120.8 KiB (+1.30% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 109340	    320	  14060	 123720	  1e348	rmk-stm32h7

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 107800	    320	  14012	 122132	  1dd14	rmk-stm32h7

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.6% +15.2Ki  [ = ]       0    .debug_str
  +0.8% +9.37Ki  [ = ]       0    .debug_info
  +1.4% +3.27Ki  [ = ]       0    .debug_loc
  +1.5% +1.50Ki  +1.5% +1.50Ki    .text
  +0.9% +1.42Ki  [ = ]       0    .debug_line
  +0.7%    +764  [ = ]       0    .strtab
  +0.9%    +720  [ = ]       0    .debug_ranges
  +0.8%    +288  [ = ]       0    .symtab
  +0.8%    +168  [ = ]       0    .debug_frame
  +0.2%     +72  [ = ]       0    .debug_aranges
  [ = ]       0  +0.4%     +48    .bss
  +0.2%     +14  [ = ]       0    .debug_abbrev
  +0.1%      +4  +0.1%      +4    .rodata
  -8.9%      -5  [ = ]       0    [Unmapped]
  +0.7% +32.7Ki  +1.3% +1.55Ki    TOTAL


```toml
[layout.regions]
left_alpha = [[0, 0], [0, 1], [1, 0], [1, 1]]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to use existing profiles to define the region, not to add a new section

- Reusable position sets may be declared under `[layout.regions]` and referenced by name with `hold_trigger_regions`. Named regions and direct positions are combined, and duplicate coordinates are ignored.
- The restriction only governs which keys may trigger the hold early. Holding the key to `hold_timeout` with nothing else pressed still reaches the hold.
- Positions are looked up by profile index, so this applies to profile-carrying tap-hold keys (`MT`/`LT`/`TH` with a profile name). A morse/tap-dance key carries its profile inline with no index to key the list by, so it is not restricted.
- `hold_trigger_on_release`: When `true`, a key outside the list produces the tap when it is *released* rather than when it is pressed. Same as ZMK's `hold-trigger-on-release`. A next key that is only tapped still settles the tap-hold as a tap, while a next key that is held leaves the hold reachable -- which is what lets same-hand modifiers combine. Defaults to `false`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it duplicate with hold_on_other_press?

@colonelpanic8
colonelpanic8 force-pushed the feat/morse-hold-trigger-on-release branch from e8d9793 to 8cc1370 Compare August 18, 2026 09:02
Completes positional hold-tap with ZMK's companion setting: keys outside
`hold_trigger_key_positions` produce the tap when they are *released* rather
than when they are pressed.

Deciding on press means pressing a second same-hand modifier settles the first
as a tap, so same-hand modifier combinations are unreachable however the
position list is written. Deferring to the release keeps both behaviors: a next
key that is only tapped still settles the tap-hold as a tap, while a next key
that is held leaves the hold reachable.

On press an excluded key is buffered rather than resolving the tap-hold, which
also keeps the two in typing order once the decision lands; its release then
runs the same check the press path would have. The profile override sits in
bits 63-62, leaving the word 8 bytes wide.

`on_release_tapped_key_settles_as_tap_unchanged` is the invariance control: its
trace is identical with the setting off, which is the point -- the deferral must
not change the tapped case. The held case is what the setting buys, and it
fails without it.
@colonelpanic8
colonelpanic8 force-pushed the feat/morse-hold-trigger-on-release branch from 8cc1370 to 61b860e Compare August 18, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants