update modtap to holdtap (#718)

* update modtap to holdtap

* Update links

* Revert "Update links"

This reverts commit 8d0cda7c5a.

* updated docs links

update links in docs

* Update docs/en/Getting_Started.md

Co-authored-by: xs5871 <60395129+xs5871@users.noreply.github.com>

* Update docs/en/Getting_Started.md

Co-authored-by: xs5871 <60395129+xs5871@users.noreply.github.com>

* rename modtap.md to holdtap.md

* Update Getting_Started.md

* Update main.py

* Update modtap.py

* Update modtap.py and add notice

* Update docs/en/porting_to_kmk.md

Co-authored-by: xs5871 <60395129+xs5871@users.noreply.github.com>

* Update docs/en/handwiring.md

Co-authored-by: xs5871 <60395129+xs5871@users.noreply.github.com>

* Update docs/en/contributing.md

Co-authored-by: xs5871 <60395129+xs5871@users.noreply.github.com>

* Update docs/en/contributing.md

Co-authored-by: xs5871 <60395129+xs5871@users.noreply.github.com>

* Update docs/en/ble_hid.md

Co-authored-by: xs5871 <60395129+xs5871@users.noreply.github.com>

* Update docs/en/Getting_Started.md

Co-authored-by: xs5871 <60395129+xs5871@users.noreply.github.com>

* Update docs/en/Getting_Started.md

Co-authored-by: xs5871 <60395129+xs5871@users.noreply.github.com>

* Update docs/en/kmkpython_vs_circuitpython.md

Co-authored-by: xs5871 <60395129+xs5871@users.noreply.github.com>

* Rename modtap.md to holdtap.md

* fixup

---------

Co-authored-by: xs5871 <60395129+xs5871@users.noreply.github.com>
This commit is contained in:
Phong Le 2023-03-03 04:32:41 -05:00 committed by GitHub
parent 94c042fec5
commit 2ccad46e26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 168 additions and 163 deletions

View File

@ -12,15 +12,15 @@ from kmk.extensions.peg_rgb_matrix import Rgb_matrix
from kmk.handlers.sequences import send_string from kmk.handlers.sequences import send_string
from kmk.hid import HIDModes from kmk.hid import HIDModes
from kmk.keys import KC from kmk.keys import KC
from kmk.modules.holdtap import HoldTap
from kmk.modules.layers import Layers from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
from kmk.modules.split import Split, SplitSide, SplitType from kmk.modules.split import Split, SplitSide, SplitType
keyboard = KMKKeyboard() keyboard = KMKKeyboard()
modtap = ModTap() holdtap = HoldTap()
layers_ext = Layers() layers_ext = Layers()
keyboard.modules.append(layers_ext) keyboard.modules.append(layers_ext)
keyboard.modules.append(modtap) keyboard.modules.append(holdtap)
oled_ext = Oled( oled_ext = Oled(
OledData( OledData(

View File

@ -12,7 +12,7 @@ Retailers (USA)
Extensions enabled by default Extensions enabled by default
- [Layers](/docs/en/layers.md) Need more keys than switches? Use layers. - [Layers](/docs/en/layers.md) Need more keys than switches? Use layers.
- [BLE_Split](/docs/en/split_keyboards.md) Connects halves without wires - [BLE_Split](/docs/en/split_keyboards.md) Connects halves without wires
- [ModTap](/docs/en/modtap.md) Allows mod keys to act as different keys when tapped. - [HoldTap](/docs/en/holdtap.md) Allows mod keys to act as different keys when tapped.
Common Extensions Common Extensions
- [Split](/docs/en/split_keyboards.md) Connects halves using a wire - [Split](/docs/en/split_keyboards.md) Connects halves using a wire

View File

@ -3,16 +3,16 @@ import board
from kb import KMKKeyboard from kb import KMKKeyboard
from kmk.keys import KC from kmk.keys import KC
from kmk.modules.holdtap import HoldTap
from kmk.modules.layers import Layers from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
from kmk.scanners import DiodeOrientation from kmk.scanners import DiodeOrientation
keyboard = KMKKeyboard() keyboard = KMKKeyboard()
keyboard.modules.append(Layers()) keyboard.modules.append(Layers())
modtap = ModTap() holdtap = HoldTap()
keyboard.modules.append(modtap) keyboard.modules.append(holdtap)
NONE = KC.NO NONE = KC.NO
@ -25,9 +25,9 @@ CAD = KC.LCTL(KC.LALT(KC.DEL))
ZSFT = KC.MT(KC.Z, KC.LSFT, prefer_hold=True, tap_interrupted=False, tap_time=3000) ZSFT = KC.HT(KC.Z, KC.LSFT, prefer_hold=True, tap_interrupted=False, tap_time=3000)
SLSHSFT = KC.MT(KC.SLSH, KC.LSFT, prefer_hold=True, tap_interrupted=False, tap_time=3000) SLSHSFT = KC.HT(KC.SLSH, KC.LSFT, prefer_hold=True, tap_interrupted=False, tap_time=3000)
ALCTL = KC.MT(KC.A, KC.LCTRL, prefer_hold=False, tap_interrupted=False, tap_time=150) ALCTL = KC.HT(KC.A, KC.LCTRL, prefer_hold=False, tap_interrupted=False, tap_time=150)
# flake8: noqa: E261 # flake8: noqa: E261
keyboard.keymap = [ keyboard.keymap = [

View File

@ -3,13 +3,12 @@
import board import board
from storage import getmount
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.quickpin.pro_micro.kb2040 import pinout as pins from kmk.quickpin.pro_micro.kb2040 import pinout as pins
from kmk.scanners.keypad import KeysScanner from kmk.scanners.keypad import KeysScanner
from storage import getmount
# GPIO to key mapping - each line is a new row. # GPIO to key mapping - each line is a new row.
# fmt: off # fmt: off
_KEY_CFG_LEFT = [ _KEY_CFG_LEFT = [

View File

@ -3,11 +3,12 @@
# https://github.com/qmk/qmk_firmware/tree/master/keyboards/ferris/keymaps/default # https://github.com/qmk/qmk_firmware/tree/master/keyboards/ferris/keymaps/default
import board import board
from kb import KMKKeyboard from kb import KMKKeyboard
from kmk.keys import KC from kmk.keys import KC
from kmk.modules.holdtap import HoldTap
from kmk.modules.layers import Layers from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
from kmk.modules.mouse_keys import MouseKeys from kmk.modules.mouse_keys import MouseKeys
from kmk.modules.split import Split, SplitSide from kmk.modules.split import Split, SplitSide
@ -27,7 +28,7 @@ split = Split(
) )
layers_ext = Layers() layers_ext = Layers()
mod_tap = ModTap() holdtap = HoldTap()
mouse_key = MouseKeys() mouse_key = MouseKeys()
@ -39,12 +40,12 @@ XXXXXXX = KC.NO
# Mod-taps # Mod-taps
A_SFT = KC.MT(KC.A, KC.LSFT) A_SFT = KC.HT(KC.A, KC.LSFT)
SCLN_SFT = KC.MT(KC.SCLN, KC.LSFT) SCLN_SFT = KC.HT(KC.SCLN, KC.LSFT)
X_CTL = KC.MT(KC.X, KC.LCTRL) X_CTL = KC.HT(KC.X, KC.LCTRL)
C_ALT = KC.MT(KC.C, KC.LALT) C_ALT = KC.HT(KC.C, KC.LALT)
COM_ALT = KC.MT(KC.COMM, KC.LALT) COM_ALT = KC.HT(KC.COMM, KC.LALT)
DOT_CTL = KC.MT(KC.DOT, KC.LCTRL) DOT_CTL = KC.HT(KC.DOT, KC.LCTRL)
CTL_ALT = KC.LCTRL(KC.LALT) CTL_ALT = KC.LCTRL(KC.LALT)

View File

@ -6,8 +6,8 @@ from kmk.extensions.media_keys import MediaKeys
from kmk.extensions.rgb import RGB from kmk.extensions.rgb import RGB
from kmk.keys import KC from kmk.keys import KC
from kmk.modules.encoder import EncoderHandler from kmk.modules.encoder import EncoderHandler
from kmk.modules.holdtap import HoldTap
from kmk.modules.layers import Layers from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
from kmk.modules.mouse_keys import MouseKeys from kmk.modules.mouse_keys import MouseKeys
keyboard = KMKKeyboard() keyboard = KMKKeyboard()
@ -21,13 +21,13 @@ XXXXXXX = KC.NO
# Adding extensions # Adding extensions
rgb = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, val_limit=50, hue_default=190, sat_default=100, val_default=5) rgb = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, val_limit=50, hue_default=190, sat_default=100, val_default=5)
modtap = ModTap() holdtap = HoldTap()
layers = Layers() layers = Layers()
media_keys = MediaKeys() media_keys = MediaKeys()
encoder_handler = EncoderHandler() encoder_handler = EncoderHandler()
keyboard.modules = [layers, modtap] #, encoder_handler] keyboard.modules = [layers, holdtap] #, encoder_handler]
keyboard.modules.append(MouseKeys()) keyboard.modules.append(MouseKeys())
keyboard.extensions = [rgb, media_keys] keyboard.extensions = [rgb, media_keys]
@ -46,14 +46,14 @@ MEDIA_BSPC = KC.LT(LYR_MEDIA, KC.BSPC)
MOUSE_M = KC.LT(LYR_MOUSE, KC.M) MOUSE_M = KC.LT(LYR_MOUSE, KC.M)
# HOMEROW MODS # HOMEROW MODS
LCTL_A = KC.MT(KC.A, KC.LCTRL) LCTL_A = KC.HT(KC.A, KC.LCTRL)
LGUI_R = KC.MT(KC.R, KC.LGUI) LGUI_R = KC.HT(KC.R, KC.LGUI)
LALT_S = KC.MT(KC.S, KC.LALT) LALT_S = KC.HT(KC.S, KC.LALT)
LSFT_T = KC.MT(KC.T, KC.LSFT) LSFT_T = KC.HT(KC.T, KC.LSFT)
RSFT_N = KC.MT(KC.N, KC.RSFT) RSFT_N = KC.HT(KC.N, KC.RSFT)
RALT_E = KC.MT(KC.E, KC.RALT) RALT_E = KC.HT(KC.E, KC.RALT)
RGUI_I = KC.MT(KC.I, KC.RGUI) RGUI_I = KC.HT(KC.I, KC.RGUI)
RCTL_O = KC.MT(KC.O, KC.RCTRL) RCTL_O = KC.HT(KC.O, KC.RCTRL)
# OTHER SHORTCUTS # OTHER SHORTCUTS
BRWSR_LFT = KC.LCTRL(KC.LSFT(KC.TAB)) BRWSR_LFT = KC.LCTRL(KC.LSFT(KC.TAB))

View File

@ -8,7 +8,7 @@ Hardware Availability: [Gherkin project on 40% Keyboards](http://www.40percent.c
Extensions enabled by default Extensions enabled by default
- [Layers](/docs/en/layers.md) Need more keys than switches? Use layers. - [Layers](/docs/en/layers.md) Need more keys than switches? Use layers.
- [ModTap](/docs/en/modtap.md) Allows mod keys to act as different keys when tapped. - [HoldTap](/docs/en/holdtap.md) Allows mod keys to act as different keys when tapped.
- [LED](/docs/en/led.md) Light your keys up - [LED](/docs/en/led.md) Light your keys up
Common Extensions Common Extensions

View File

@ -2,17 +2,17 @@ from kb import KMKKeyboard
from kmk.extensions.led import LED from kmk.extensions.led import LED
from kmk.keys import KC from kmk.keys import KC
from kmk.modules.holdtap import HoldTap
from kmk.modules.layers import Layers from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
keyboard = KMKKeyboard() keyboard = KMKKeyboard()
modtap = ModTap() holdtap = HoldTap()
layers_ext = Layers() layers_ext = Layers()
led = LED() led = LED()
keyboard.extensions = [led] keyboard.extensions = [led]
keyboard.modules = [layers_ext, modtap] keyboard.modules = [layers_ext, holdtap]
# Cleaner key names # Cleaner key names
_______ = KC.TRNS _______ = KC.TRNS

View File

@ -2,6 +2,7 @@ from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.quickpin.pro_micro.sparkfun_promicro_rp2040 import pinout as pins from kmk.quickpin.pro_micro.sparkfun_promicro_rp2040 import pinout as pins
from kmk.scanners import DiodeOrientation from kmk.scanners import DiodeOrientation
class KMKKeyboard(_KMKKeyboard): class KMKKeyboard(_KMKKeyboard):
col_pins = ( col_pins = (
pins[19], pins[19],

View File

@ -31,7 +31,7 @@ It has the following modules/extensions enabled:
- [Split](/docs/en/split_keyboards.md) Connects halves using a wire - [Split](/docs/en/split_keyboards.md) Connects halves using a wire
- [Layers](/docs/en/layers.md) Do you need more keys than switches? Use - [Layers](/docs/en/layers.md) Do you need more keys than switches? Use
layers. layers.
- [ModTap](/docs/en/modtap.md) Enable press/hold double binding of keys - [HoldTap](/docs/en/holdtap.md) Enable press/hold double binding of keys
- [MediaKeys](/docs/en/media_keys.md) Common media controls - [MediaKeys](/docs/en/media_keys.md) Common media controls
Also uncomment right section to enable samples of following: Also uncomment right section to enable samples of following:

View File

@ -4,15 +4,15 @@ from kmk.extensions.media_keys import MediaKeys
from kmk.extensions.rgb import RGB, AnimationModes from kmk.extensions.rgb import RGB, AnimationModes
from kmk.keys import KC from kmk.keys import KC
from kmk.modules.encoder import EncoderHandler from kmk.modules.encoder import EncoderHandler
from kmk.modules.holdtap import HoldTap
from kmk.modules.layers import Layers from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
from kmk.modules.split import Split, SplitType from kmk.modules.split import Split, SplitType
keyboard = KMKKeyboard() keyboard = KMKKeyboard()
keyboard.debug_enabled = True keyboard.debug_enabled = True
keyboard.modules.append(Layers()) keyboard.modules.append(Layers())
keyboard.modules.append(ModTap()) keyboard.modules.append(HoldTap())
keyboard.extensions.append(MediaKeys()) keyboard.extensions.append(MediaKeys())
# Using drive names (KYRIAL, KYRIAR) to recognize sides; use split_side arg if you're not doing it # Using drive names (KYRIAL, KYRIAR) to recognize sides; use split_side arg if you're not doing it
@ -33,10 +33,10 @@ keyboard.extensions.append(rgb_ext)
# Edit your layout below # Edit your layout below
# Currently, that's a default QMK Kyria Layout - https://config.qmk.fm/#/splitkb/kyria/rev1/LAYOUT # Currently, that's a default QMK Kyria Layout - https://config.qmk.fm/#/splitkb/kyria/rev1/LAYOUT
ESC_LCTL = KC.MT(KC.ESC, KC.LCTL) ESC_LCTL = KC.HT(KC.ESC, KC.LCTL)
QUOTE_RCTL = KC.MT(KC.QUOTE, KC.RCTL) QUOTE_RCTL = KC.HT(KC.QUOTE, KC.RCTL)
ENT_LALT = KC.MT(KC.ENT, KC.LALT) ENT_LALT = KC.HT(KC.ENT, KC.LALT)
MINUS_RCTL = KC.MT(KC.MINUS, KC.RCTL) MINUS_RCTL = KC.HT(KC.MINUS, KC.RCTL)
keyboard.keymap = [ keyboard.keymap = [
[ [
KC.TAB, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.BSPC, KC.TAB, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.BSPC,

View File

@ -8,8 +8,8 @@ from kb import KMKKeyboard
from kmk.extensions.media_keys import MediaKeys from kmk.extensions.media_keys import MediaKeys
from kmk.extensions.RGB import RGB, AnimationModes from kmk.extensions.RGB import RGB, AnimationModes
from kmk.keys import KC from kmk.keys import KC
from kmk.modules.holdtap import HoldTap
from kmk.modules.layers import Layers from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
from kmk.modules.split import Split, SplitSide, SplitType from kmk.modules.split import Split, SplitSide, SplitType
led = digitalio.DigitalInOut(board.GP25) led = digitalio.DigitalInOut(board.GP25)
@ -20,7 +20,7 @@ keyboard = KMKKeyboard()
keyboard.tap_time = 100 keyboard.tap_time = 100
layers_ext = Layers() layers_ext = Layers()
modtap_ext = ModTap() holdtap_ext = HoldTap()
# TODO Comment one of these on each side # TODO Comment one of these on each side
split_side = SplitSide.LEFT split_side = SplitSide.LEFT
@ -43,7 +43,7 @@ rgb_ext = RGB(
animation_mode=AnimationModes.BREATHING_RAINBOW animation_mode=AnimationModes.BREATHING_RAINBOW
) )
keyboard.modules = [layers_ext, modtap_ext, split] keyboard.modules = [layers_ext, holdtap_ext, split]
keyboard.extensions.append(MediaKeys()) keyboard.extensions.append(MediaKeys())
keyboard.extensions.append(rgb_ext) keyboard.extensions.append(rgb_ext)
@ -61,9 +61,9 @@ if split_side == SplitSide.LEFT:
LOWER = KC.MO(1) LOWER = KC.MO(1)
RAISE = KC.MO(2) RAISE = KC.MO(2)
ADJUST = KC.MO(3) ADJUST = KC.MO(3)
CT_TAB = KC.MT(KC.TAB, KC.LCTRL) CT_TAB = KC.HT(KC.TAB, KC.LCTRL)
CT_QUOT = KC.MT(KC.QUOT, KC.LCTRL) CT_QUOT = KC.HT(KC.QUOT, KC.LCTRL)
SF_MINS = KC.MT(KC.MINS, KC.LSHIFT) SF_MINS = KC.HT(KC.MINS, KC.LSHIFT)
SG_PSCR = KC.LSFT(KC.LGUI(KC.PSCR)) SG_PSCR = KC.LSFT(KC.LGUI(KC.PSCR))
SF_PSCR = KC.LSFT(KC.PSCR) SF_PSCR = KC.LSFT(KC.PSCR)
CG_RGHT = KC.LCTRL(KC.LGUI(KC.RGHT)) CG_RGHT = KC.LCTRL(KC.LGUI(KC.RGHT))

View File

@ -17,7 +17,7 @@ Retailers (USA)
Extensions enabled by default Extensions enabled by default
- [Layers](/docs/en/layers.md) Need more keys than switches? Use layers. - [Layers](/docs/en/layers.md) Need more keys than switches? Use layers.
- [RGB](/docs/en/rgb.md) Light it up - [RGB](/docs/en/rgb.md) Light it up
- [ModTap](/docs/en/modtap.md) Allows mod keys to act as different keys when tapped. - [HoldTap](/docs/en/holdtap.md) Allows mod keys to act as different keys when tapped.
Common Extensions Common Extensions
- [Power](/docs/en/power.md) Powersaving features for battery life - [Power](/docs/en/power.md) Powersaving features for battery life

View File

@ -2,18 +2,18 @@ from kb import KMKKeyboard
from kmk.extensions.rgb import RGB from kmk.extensions.rgb import RGB
from kmk.keys import KC from kmk.keys import KC
from kmk.modules.holdtap import HoldTap
from kmk.modules.layers import Layers from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
keyboard = KMKKeyboard() keyboard = KMKKeyboard()
# Adding extensions # Adding extensions
rgb = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, val_limit=100, hue_default=190, sat_default=100, val_default=5) rgb = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, val_limit=100, hue_default=190, sat_default=100, val_default=5)
modtap = ModTap() holdtap = HoldTap()
layers_ext = Layers() layers_ext = Layers()
keyboard.modules = [layers_ext, modtap] keyboard.modules = [layers_ext, holdtap]
keyboard.extensions = [rgb] keyboard.extensions = [rgb]
# Cleaner key names # Cleaner key names

View File

@ -18,7 +18,7 @@ Retailers (USA)
Extensions enabled by default Extensions enabled by default
- [Layers](/docs/en/layers.md) Need more keys than switches? Use layers. - [Layers](/docs/en/layers.md) Need more keys than switches? Use layers.
- [RGB](/docs/en/rgb.md) Light it up - [RGB](/docs/en/rgb.md) Light it up
- [ModTap](/docs/en/modtap.md) Allows mod keys to act as different keys when tapped. - [HoldTap](/docs/en/holdtap.md) Allows mod keys to act as different keys when tapped.
Common Extensions Common Extensions
- [Power](/docs/en/power.md) Powersaving features for battery life - [Power](/docs/en/power.md) Powersaving features for battery life

View File

@ -2,18 +2,18 @@ from kb import KMKKeyboard
from kmk.extensions.rgb import RGB from kmk.extensions.rgb import RGB
from kmk.keys import KC from kmk.keys import KC
from kmk.modules.holdtap import HoldTap
from kmk.modules.layers import Layers from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
keyboard = KMKKeyboard() keyboard = KMKKeyboard()
# Adding extensions # Adding extensions
rgb = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, val_limit=100, hue_default=190, sat_default=100, val_default=5) rgb = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, val_limit=100, hue_default=190, sat_default=100, val_default=5)
modtap = ModTap() holdtap = HoldTap()
layers_ext = Layers() layers_ext = Layers()
keyboard.modules = [layers_ext, modtap] keyboard.modules = [layers_ext, holdtap]
keyboard.extensions = [rgb] keyboard.extensions = [rgb]
# Cleaner key names # Cleaner key names
@ -23,8 +23,8 @@ XXXXXXX = KC.NO
LOWER = KC.MO(1) LOWER = KC.MO(1)
RAISE = KC.MO(2) RAISE = KC.MO(2)
ADJUST = KC.LT(3, KC.SPC) ADJUST = KC.LT(3, KC.SPC)
RSFT_ENT = KC.MT(KC.ENT, KC.RSFT) RSFT_ENT = KC.HT(KC.ENT, KC.RSFT)
RSFT_SPC = KC.MT(KC.SPC, KC.RSFT) RSFT_SPC = KC.HT(KC.SPC, KC.RSFT)
RGB_TOG = KC.RGB_TOG RGB_TOG = KC.RGB_TOG
RGB_HUI = KC.RGB_HUI RGB_HUI = KC.RGB_HUI

View File

@ -14,7 +14,7 @@ Retailers (USA)
Extensions enabled by default Extensions enabled by default
- [Layers](/docs/en/layers.md) Need more keys than switches? Use layers. - [Layers](/docs/en/layers.md) Need more keys than switches? Use layers.
- [BLE_Split](/docs/en/split_keyboards.md) Connects halves without wires - [BLE_Split](/docs/en/split_keyboards.md) Connects halves without wires
- [ModTap](/docs/en/modtap.md) Allows mod keys to act as different keys when tapped. - [HoldTap](/docs/en/holdtap.md) Allows mod keys to act as different keys when tapped.
Common Extensions Common Extensions
- [Split](/docs/en/split_keyboards.md) Connects halves using a wire - [Split](/docs/en/split_keyboards.md) Connects halves using a wire

View File

@ -12,15 +12,15 @@ from kmk.extensions.peg_rgb_matrix import Rgb_matrix
from kmk.handlers.sequences import send_string from kmk.handlers.sequences import send_string
from kmk.hid import HIDModes from kmk.hid import HIDModes
from kmk.keys import KC from kmk.keys import KC
from kmk.modules.holdtap import HoldTap
from kmk.modules.layers import Layers from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
from kmk.modules.split import Split, SplitSide, SplitType from kmk.modules.split import Split, SplitSide, SplitType
keyboard = KMKKeyboard() keyboard = KMKKeyboard()
modtap = ModTap() holdtap = HoldTap()
layers_ext = Layers() layers_ext = Layers()
keyboard.modules.append(layers_ext) keyboard.modules.append(layers_ext)
keyboard.modules.append(modtap) keyboard.modules.append(holdtap)
oled_ext = Oled( oled_ext = Oled(
OledData( OledData(

View File

@ -2,7 +2,7 @@
> Life was like a box of chocolates. You never know what you're gonna get. > Life was like a box of chocolates. You never know what you're gonna get.
KMK is a keyboard focused layer that sits on top of [CircuitPython](https://circuitpython.org/). As such, it should work with most [boards that support CircuitPython](https://circuitpython.org/downloads). KMK requires CircuitPython version 7.0 or above. KMK is a keyboard focused layer that sits on top of [CircuitPython](https://circuitpython.org/). As such, it should work with most [boards that support CircuitPython](https://circuitpython.org/downloads). KMK requires CircuitPython version 7.0 or above.
Known working and recommended devices can be found [here](Officially_Supported_Microcontrollers.md) Known working and recommended devices can be found in the [list of officially supported microcontrollers](Officially_Supported_Microcontrollers.md)
## TL;DR Quick start guide ## TL;DR Quick start guide
@ -50,19 +50,21 @@ if __name__ == '__main__':
> This is your last chance. After this, there is no turning back. You take the blue pill—the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill—you stay in Wonderland, and I show you how deep the rabbit hole goes. Remember: all I'm offering is the truth. Nothing more. > This is your last chance. After this, there is no turning back. You take the blue pill—the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill—you stay in Wonderland, and I show you how deep the rabbit hole goes. Remember: all I'm offering is the truth. Nothing more.
### You're extremely lucky and you have a fully supported keyboard ### You're extremely lucky and you have a fully supported keyboard
If your keyboard and microcontroller are officially supported, simply visit the page for your files, and dropping them on the root of the "flash drive". Those pages can be found [here](https://github.com/KMKfw/kmk_firmware/tree/master/boards). You will need the `kb.py` and `main.py`. More advanced instructions can be found [here](config_and_keymap.md). If your keyboard and microcontroller are officially supported, simply visit the page for your files, and dropping them on the root of the "flash drive".
Those pages can be found in the repositories [boards folder](https://github.com/KMKfw/kmk_firmware/tree/master/boards).
You will need the `kb.py` and `main.py`. If you need more detailed instructions on how to customize the configuration settings and key mappings, please refer to the [config and keymap](config_and_keymap.md) documentation.
### You've got another, maybe DIY, board and want to customize KMK for it ### You've got another, maybe DIY, board and want to customize KMK for it
First, be sure to understand how your device work, and particularly its specific matrix configuration. You can have a look [here](http://pcbheaven.com/wikipages/How_Key_Matrices_Works/) or read the [guide](https://docs.qmk.fm/#/hand_wire) provided by the QMK team for handwired keyboards First, be sure to understand how your device work, and particularly its specific matrix configuration. You can have a look at [how key matrices work](http://pcbheaven.com/wikipages/How_Key_Matrices_Works/) or read the [guide](https://docs.qmk.fm/#/hand_wire) provided by the QMK team for handwired keyboards
Once you've got the gist of it: Once you've got the gist of it:
- You can have a look [here](config_and_keymap.md) and [here](keys.md) to start customizing your code.py / main.py file - To start customizing your `code.py`/`main.py` file, please refer to the [config and keymap](config_and_keymap.md) and [keys](keys.md) files respectively, which provide detailed instructions on how to modify the configuration settings and key mappings.
- There's a [reference](keycodes.md) of the available keycodes - There's a [reference](keycodes.md) of the available keycodes
- [International](international.md) extension adds keys for non US layouts and [Media Keys](media_keys.md) adds keys for ... media - [International](international.md) extension adds keys for non US layouts and [Media Keys](media_keys.md) adds keys for ... media
And to go even further: And to go even further:
- [Sequences](sequences.md) are used for sending multiple keystrokes in a single action - [Sequences](sequences.md) are used for sending multiple keystrokes in a single action
- [Layers](layers.md) can transform the whole way your keyboard is behaving with a single touch - [Layers](layers.md) can transform the whole way your keyboard is behaving with a single touch
- [ModTap](modtap.md) allow you to customize the way a key behaves whether it is tapped or hold, and [TapDance](tapdance.md) depending on the number of times it is pressed - [HoldTap](holdtap.md) allow you to customize the way a key behaves whether it is tapped or hold, and [TapDance](tapdance.md) depending on the number of times it is pressed
Want to have fun features such as RGB, split keyboards and more? Check out what builtin [modules](modules.md) and [extensions](extensions.md) can do! Want to have fun features such as RGB, split keyboards and more? Check out what builtin [modules](modules.md) and [extensions](extensions.md) can do!
You can also get ideas from the various [user examples](https://github.com/KMKfw/kmk_firmware/tree/master/user_keymaps) that we provide and dig into our [documentation](README.md). You can also get ideas from the various [user examples](https://github.com/KMKfw/kmk_firmware/tree/master/user_keymaps) that we provide and dig into our [documentation](README.md).

View File

@ -25,7 +25,7 @@
- [Combos](combos.md): Adds chords and sequences - [Combos](combos.md): Adds chords and sequences
- [Layers](layers.md): Adds layer support (Fn key) to allow many more keys to be put on your keyboard - [Layers](layers.md): Adds layer support (Fn key) to allow many more keys to be put on your keyboard
- [ModTap](modtap.md): Adds support for augmented modifier keys to act as one key when tapped, and modifier when held. - [HoldTap](holdtap.md): Adds support for augmented modifier keys to act as one key when tapped, and modifier when held.
- [Mouse keys](mouse_keys.md): Adds mouse keycodes - [Mouse keys](mouse_keys.md): Adds mouse keycodes
- [OneShot](oneshot.md): Adds support for oneshot/sticky keys. - [OneShot](oneshot.md): Adds support for oneshot/sticky keys.
- [Power](power.md): Power saving features. This is mostly useful when on battery power. - [Power](power.md): Power saving features. This is mostly useful when on battery power.

View File

@ -3,8 +3,8 @@ Bluetooth connections help clean up the wire mess!
## CircuitPython ## CircuitPython
If not running KMKPython, this does require the adafruit_ble library from Adafruit. If not running KMKPython, this does require the adafruit_ble library from Adafruit.
This can be downloaded This can be downloaded from the
[here](https://github.com/adafruit/Adafruit_CircuitPython_BLE/tree/master/adafruit_ble). [Adafruit CircuitPython BLE repository](https://github.com/adafruit/Adafruit_CircuitPython_BLE/tree/master/adafruit_ble).
It is part of the [Adafruit CircuitPython Bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle). It is part of the [Adafruit CircuitPython Bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).
Simply put this in the "root" of your CircuitPython device. If unsure, it's the folder with main.py in it, and should be the first folder you see when you open the device. Simply put this in the "root" of your CircuitPython device. If unsure, it's the folder with main.py in it, and should be the first folder you see when you open the device.

View File

@ -1,6 +1,6 @@
# CapsWord # CapsWord
The CapsWord module functions similar to caps lock but will deactivate automatically when its encounters a key that breaks the word or after inactivity timeout. The CapsWord module functions similar to caps lock but will deactivate automatically when its encounters a key that breaks the word or after inactivity timeout.
By default it will not deactivate CapsWord on numbers, alphabets, underscore, modifiers, minus, backspace and other keys like ModTap, Layers, etc. By default it will not deactivate CapsWord on numbers, alphabets, underscore, modifiers, minus, backspace and other keys like HoldTap, Layers, etc.
Add it to your keyboard's modules list with: Add it to your keyboard's modules list with:
```python ```python

View File

@ -40,8 +40,8 @@ and a willingness to write them up, it's a good idea to familiarize yourself wit
the docs. Documentation should be informative but concise. the docs. Documentation should be informative but concise.
### Styling ### Styling
Docs are written and rendered in GitHub Markdown. A comprehensive guide to GitHub's Docs are written and rendered in GitHub Markdown.
Markdown can be found [here](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax). Check out this comprehensive [guide to basic writing and formatting syntax](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) from GitHub's documentation.
In particular, KMK's docs should include a title, demarcated with `#`, and subheadings In particular, KMK's docs should include a title, demarcated with `#`, and subheadings
should be demarcated with `##`, `###`, and so on. Headings should be short and specific. should be demarcated with `##`, `###`, and so on. Headings should be short and specific.

View File

@ -23,7 +23,7 @@ Here is all you need to use this module in your `main.py` / `code.py` file.
```python ```python
from kmk.modules.encoder import EncoderHandler from kmk.modules.encoder import EncoderHandler
encoder_handler = EncoderHandler() encoder_handler = EncoderHandler()
keyboard.modules = [layers, modtap, encoder_handler] keyboard.modules = [layers, holdtap, encoder_handler]
``` ```
2. Define the pins for each encoder: `pin_a`, `pin_b` for rotations, `pin_button` for the switch in the encoder. Set switch to `None` if the encoder's button is handled differently (as a part of matrix for example) or not at all. If you want to invert the direction of the encoder, set the 4th (optional) parameter `is_inverted` to `True`. 5th parameter is [encoder divisor](#encoder-resolution) (optional), it can be either `2` or `4`. 2. Define the pins for each encoder: `pin_a`, `pin_b` for rotations, `pin_button` for the switch in the encoder. Set switch to `None` if the encoder's button is handled differently (as a part of matrix for example) or not at all. If you want to invert the direction of the encoder, set the 4th (optional) parameter `is_inverted` to `True`. 5th parameter is [encoder divisor](#encoder-resolution) (optional), it can be either `2` or `4`.

View File

@ -24,9 +24,8 @@ make MOUNTPOINT=/media/CIRCUITPY USER_KEYMAP=user_keymaps/nameofyourkeymap.py BO
Check to see if your drive may have mounted elsewhere with a GUI tool or other Check to see if your drive may have mounted elsewhere with a GUI tool or other
automounter. Most of these tools will mount your device under `/media`, probably automounter. Most of these tools will mount your device under `/media`, probably
as `/media/CIRCUITPY`. If it's not mounted, you can read up on how to mount a as `/media/CIRCUITPY`. If it's not mounted, you can read up on how to [mount a
drive manually drive manually](https://wiki.archlinux.org/index.php/File_systems#Mount_a_file_system).
[here](https://wiki.archlinux.org/index.php/File_systems#Mount_a_file_system).
For example, For example,

View File

@ -1,6 +1,6 @@
# Handwire keyboards # Handwire keyboards
This guide will not talk about the physical wiring. Check out our This guide will not talk about the physical wiring. Check out our
[recommended microcontrollers](Officially_Supported_Microcontrollers.md) and [recommended microcontrollers](Officially_Supported_Microcontrollers.md) and
follow the amazing guide for that [here](https://docs.qmk.fm/#/hand_wire). That follow this amazing [hand wiring guide](https://docs.qmk.fm/#/hand_wire). That
guide can be followed until you are setting up the firmware. After wiring the guide can be followed until you are setting up the firmware. After wiring the
keyboard, you can refer to our porting guide [here](porting_to_kmk.md) keyboard, you can refer to our porting guide [here](porting_to_kmk.md)

View File

@ -1,39 +1,39 @@
# ModTap Keycodes # HoldTap Keycodes
Enabling ModTap will give you access to the following keycodes and can simply be Enabling HoldTap will give you access to the following keycodes and can simply be
added to the modules list. added to the modules list.
```python ```python
from kmk.modules.modtap import ModTap from kmk.modules.holdtap import HoldTap
modtap = ModTap() holdtap = HoldTap()
# optional: set a custom tap timeout in ms # optional: set a custom tap timeout in ms
# modtap.tap_time = 300 # holdtap.tap_time = 300
keyboard.modules.append(modtap) keyboard.modules.append(holdtap)
``` ```
## Keycodes ## Keycodes
|New Keycode | Description | |New Keycode | Description |
|---------------------------------------------------------|-----------------------------------------------------------------| |---------------------------------------------------------|-----------------------------------------------------------------|
|`LCTL = KC.MT(KC.SOMETHING, KC.LCTRL)` |`LCTRL` if held `kc` if tapped | |`LCTL = KC.HT(KC.SOMETHING, KC.LCTRL)` |`LCTRL` if held `kc` if tapped |
|`LSFT = KC.MT(KC.SOMETHING, KC.LSFT)` |`LSHIFT` if held `kc` if tapped | |`LSFT = KC.HT(KC.SOMETHING, KC.LSFT)` |`LSHIFT` if held `kc` if tapped |
|`LALT = KC.MT(KC.SOMETHING, KC.LALT)` |`LALT` if held `kc` if tapped | |`LALT = KC.HT(KC.SOMETHING, KC.LALT)` |`LALT` if held `kc` if tapped |
|`LGUI = KC.MT(KC.SOMETHING, KC.LGUI)` |`LGUI` if held `kc` if tapped | |`LGUI = KC.HT(KC.SOMETHING, KC.LGUI)` |`LGUI` if held `kc` if tapped |
|`RCTL = KC.MT(KC.SOMETHING, KC.RCTRL)` |`RCTRL` if held `kc` if tapped | |`RCTL = KC.HT(KC.SOMETHING, KC.RCTRL)` |`RCTRL` if held `kc` if tapped |
|`RSFT = KC.MT(KC.SOMETHING, KC.RSFT)` |`RSHIFT` if held `kc` if tapped | |`RSFT = KC.HT(KC.SOMETHING, KC.RSFT)` |`RSHIFT` if held `kc` if tapped |
|`RALT = KC.MT(KC.SOMETHING, KC.RALT)` |`RALT` if held `kc` if tapped | |`RALT = KC.HT(KC.SOMETHING, KC.RALT)` |`RALT` if held `kc` if tapped |
|`RGUI = KC.MT(KC.SOMETHING, KC.RGUI)` |`RGUI` if held `kc` if tapped | |`RGUI = KC.HT(KC.SOMETHING, KC.RGUI)` |`RGUI` if held `kc` if tapped |
|`SGUI = KC.MT(KC.SOMETHING, KC.LSHFT(KC.LGUI))` |`LSHIFT` and `LGUI` if held `kc` if tapped | |`SGUI = KC.HT(KC.SOMETHING, KC.LSHFT(KC.LGUI))` |`LSHIFT` and `LGUI` if held `kc` if tapped |
|`LCA = KC.MT(KC.SOMETHING, KC.LCTRL(KC.LALT))` |`LCTRL` and `LALT` if held `kc` if tapped | |`LCA = KC.HT(KC.SOMETHING, KC.LCTRL(KC.LALT))` |`LCTRL` and `LALT` if held `kc` if tapped |
|`LCAG = KC.MT(KC.SOMETHING, KC.LCTRL(KC.LALT(KC.LGUI)))` |`LCTRL` and `LALT` and `LGUI` if held `kc` if tapped | |`LCAG = KC.HT(KC.SOMETHING, KC.LCTRL(KC.LALT(KC.LGUI)))` |`LCTRL` and `LALT` and `LGUI` if held `kc` if tapped |
|`MEH = KC.MT(KC.SOMETHING, KC.LCTRL(KC.LSFT(KC.LALT)))` |`CTRL` and `LSHIFT` and `LALT` if held `kc` if tapped | |`MEH = KC.HT(KC.SOMETHING, KC.LCTRL(KC.LSFT(KC.LALT)))` |`CTRL` and `LSHIFT` and `LALT` if held `kc` if tapped |
|`HYPR = KC.MT(KC.SOMETHING, KC.HYPR)` |`LCTRL` and `LSHIFT` and `LALT` and `LGUI` if held `kc` if tapped| |`HYPR = KC.HT(KC.SOMETHING, KC.HYPR)` |`LCTRL` and `LSHIFT` and `LALT` and `LGUI` if held `kc` if tapped|
## Custom HoldTap Behavior ## Custom HoldTap Behavior
The full ModTap signature is as follows: The full HoldTap signature is as follows:
```python ```python
KC.MT(KC.TAP, KC.HOLD, prefer_hold=True, tap_interrupted=False, tap_time=None, repeat=HoldTapRepeat.NONE) KC.HT(KC.TAP, KC.HOLD, prefer_hold=True, tap_interrupted=False, tap_time=None, repeat=HoldTapRepeat.NONE)
``` ```
* `prefer_hold`: decides which keycode the ModTap key resolves to when another * `prefer_hold`: decides which keycode the HoldTap key resolves to when another
key is pressed before the timeout finishes. When `True` the hold keycode is key is pressed before the timeout finishes. When `True` the hold keycode is
chosen, the tap keycode when `False`. chosen, the tap keycode when `False`.
* `tap_interrupted`: decides if the timeout will interrupt at the first other * `tap_interrupted`: decides if the timeout will interrupt at the first other
@ -48,4 +48,4 @@ KC.MT(KC.TAP, KC.HOLD, prefer_hold=True, tap_interrupted=False, tap_time=None, r
* `NONE`: no repeat action (default), everything works as expected. * `NONE`: no repeat action (default), everything works as expected.
The `HoldTapRepeat` enum must be imported from `kmk.modules.holdtap`. The `HoldTapRepeat` enum must be imported from `kmk.modules.holdtap`.
Each of these parameters can be set for every ModTap key individually. Each of these parameters can be set for every HoldTap key individually.

View File

@ -15,7 +15,7 @@ the box.
### CircuitPython ### CircuitPython
CircuitPython can be installed by following this guide using the guide CircuitPython can be installed by following this guide using the guide
[here](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython). for [installing circuit python](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython).
It's recommended to run the latest stable version that is at least 5.0 or higher. It's recommended to run the latest stable version that is at least 5.0 or higher.
Beta versions may work, but expect limited support. Beta versions may work, but expect limited support.
#### Notable differences include #### Notable differences include

View File

@ -21,7 +21,7 @@ keyboard.modules.append(Layers())
## Custom HoldTap Behavior ## Custom HoldTap Behavior
`KC.TT` and `KC.LT` use the same heuristic to determine taps and holds as `KC.TT` and `KC.LT` use the same heuristic to determine taps and holds as
ModTap. Check out the [ModTap doc](modtap.md) to find out more. HoldTap. Check out the [HoldTap doc](holdtap.md) to find out more.
## Working with Layers ## Working with Layers
When starting out, care should be taken when working with layers, since it's possible to lock When starting out, care should be taken when working with layers, since it's possible to lock

View File

@ -10,7 +10,7 @@ modules are
- [Combos](combos.md): Adds chords and sequences - [Combos](combos.md): Adds chords and sequences
- [Layers](layers.md): Adds layer support (Fn key) to allow many more keys to be - [Layers](layers.md): Adds layer support (Fn key) to allow many more keys to be
put on your keyboard. put on your keyboard.
- [ModTap](modtap.md): Adds support for augmented modifier keys to act as one key - [HoldTap](holdtap.md): Adds support for augmented modifier keys to act as one key
when tapped, and modifier when held. when tapped, and modifier when held.
- [Mouse keys](mouse_keys.md): Adds mouse keycodes. - [Mouse keys](mouse_keys.md): Adds mouse keycodes.
- [OneShot](oneshot.md): Adds support for oneshot/sticky keys. - [OneShot](oneshot.md): Adds support for oneshot/sticky keys.

View File

@ -17,7 +17,7 @@ To use this you need to make some changes to your kb.py as well as you main.py I
You need these frozen into your circuitpython or in a lib folder at the root of your drive. You need these frozen into your circuitpython or in a lib folder at the root of your drive.
* [Adafruit_CircuitPython_DisplayIO_SSD1306](https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306) * [Adafruit_CircuitPython_DisplayIO_SSD1306](https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306)
* [Adafruit_CircuitPython_Display_Text](https://github.com/adafruit/Adafruit_CircuitPython_Display_Text) * [Adafruit_CircuitPython_Display_Text](https://github.com/adafruit/Adafruit_CircuitPython_Display_Text)
* [Download .mpy versions from here](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20220415/adafruit-circuitpython-bundle-7.x-mpy-20220415.zip) * [Download .mpy versions from Adafruit_CircuitPython_Bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20220415/adafruit-circuitpython-bundle-7.x-mpy-20220415.zip)
## kb.py ## kb.py

View File

@ -30,7 +30,7 @@ Currently this extension does not support changing LEDs at runtime, as a result
The following libraries must be frozen in your CircuitPython distribution or in a 'lib' folder at the root of your drive. The following libraries must be frozen in your CircuitPython distribution or in a 'lib' folder at the root of your drive.
* [Adafruit_CircuitPython_NeoPixel](https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel) * [Adafruit_CircuitPython_NeoPixel](https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel)
* [Download .mpy versions from here](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20220415/adafruit-circuitpython-bundle-7.x-mpy-20220415.zip) * [Download .mpy versions from Adafruit_CircuitPython_Bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20220415/adafruit-circuitpython-bundle-7.x-mpy-20220415.zip)
## Required Changes to main.py and kb.py ## Required Changes to main.py and kb.py

View File

@ -126,4 +126,4 @@ if __name__ == '__main__':
``` ```
## More information ## More information
More information on keymaps can be found [here](config_and_keymap.md) More information on keymaps can be found in the [config and keymap](config_and_keymap.md) documentation.

View File

@ -2,7 +2,7 @@
Split keyboards are mostly the same as unsplit. Wired UART is fully supported, Split keyboards are mostly the same as unsplit. Wired UART is fully supported,
and testing of Bluetooth splits, though we don't currently offer support for this. and testing of Bluetooth splits, though we don't currently offer support for this.
Notice that this Split module must be added after the ModTap module to the keyboard.modules. Notice that this Split module must be added after the HoldTap module to the keyboard.modules.
## Drive names ## Drive names
As you will have two circuitpython drives to update regularly, it is adviced to rename them to make As you will have two circuitpython drives to update regularly, it is adviced to rename them to make

View File

@ -46,7 +46,7 @@ EXAMPLE_TD = KC.TD(
# Tap once for "a" # Tap once for "a"
KC.A, KC.A,
# Tap twice for "b", or tap and hold for "left control" # Tap twice for "b", or tap and hold for "left control"
KC.MT(KC.B, KC.LCTL, prefer_hold=False), KC.HT(KC.B, KC.LCTL, prefer_hold=False),
# Tap three times to send a raw string via macro # Tap three times to send a raw string via macro
send_string('macros in a tap dance? I think yes'), send_string('macros in a tap dance? I think yes'),
# Tap four times to toggle layer index 1, tap 3 times and hold for 3s to # Tap four times to toggle layer index 1, tap 3 times and hold for 3s to

View File

@ -80,7 +80,7 @@ QMK チームが提供している手配線キーボード用の[ガイド](http
- [シーケンス](sequences.md) 一つのアクションで複数のキーストロークを送信するために使用します。 - [シーケンス](sequences.md) 一つのアクションで複数のキーストロークを送信するために使用します。
- [レイヤー](layers.md)でタッチ一つでキーボードの全体の動きを変えることができます。 - [レイヤー](layers.md)でタッチ一つでキーボードの全体の動きを変えることができます。
- [モドタップ](modtap.md) でキーの押し/長押しの動作を設定し、何回押されたかによって[タップダンス](tapdance.md)を設定します。 - [モドタップ](holdtap.md) でキーの押し/長押しの動作を設定し、何回押されたかによって[タップダンス](tapdance.md)を設定します。
RGB や分裂型などの機能を楽しめたい場合は、ビルトイン[モジュール](modules.md)と[拡張機能](extensions.md)を見てみてください! RGB や分裂型などの機能を楽しめたい場合は、ビルトイン[モジュール](modules.md)と[拡張機能](extensions.md)を見てみてください!

View File

@ -101,7 +101,7 @@ E para ir mais além:
só. só.
- [Camadas](layers.md) podem transformar totalmente como seu teclado age com um - [Camadas](layers.md) podem transformar totalmente como seu teclado age com um
simples toque. simples toque.
- [ModTap](modtap.md) te permite customizar a maneira que uma tecla age quando é - [HoldTap](holdtap.md) te permite customizar a maneira que uma tecla age quando é
pressionada ou "segurada"; e o pressionada ou "segurada"; e o
- [TapDance](tapdance.md) dependendo do número de vezes que ela é pressionada. - [TapDance](tapdance.md) dependendo do número de vezes que ela é pressionada.

View File

@ -1,27 +1,27 @@
# Keycodes ModTap # Keycodes HoldTap
Habilitar o ModTap (adicionando-o à lista de módulos) te dará acesso aos Habilitar o HoldTap (adicionando-o à lista de módulos) te dará acesso aos
keycodes abaixo: keycodes abaixo:
```python ```python
from kmk.modules.modtap import ModTap from kmk.modules.holdtap import HoldTap
keyboard.modules.append(ModTap()) keyboard.modules.append(HoldTap())
``` ```
## Keycodes ## Keycodes
| Novo Keycode | Descrição | | Novo Keycode | Descrição |
|--------------------------------------------------------|-----------------------------------------------------------------| |--------------------------------------------------------|-----------------------------------------------------------------|
| LCTL = KC.MT(KC.SOMETHING, KC.LCTRL) | `LCTRL` se segurado `kc` se tocado | | LCTL = KC.HT(KC.SOMETHING, KC.LCTRL) | `LCTRL` se segurado `kc` se tocado |
| LSFT = KC.MT(KC.SOMETHING, KC.LSFT) | `LSHIFT` se segurado `kc` se tocado | | LSFT = KC.HT(KC.SOMETHING, KC.LSFT) | `LSHIFT` se segurado `kc` se tocado |
| LALT = KC.MT(KC.SOMETHING, KC.LALT) | `LALT` se segurado `kc` se tocado | | LALT = KC.HT(KC.SOMETHING, KC.LALT) | `LALT` se segurado `kc` se tocado |
| LGUI = KC.MT(KC.SOMETHING, KC.LGUI) | `LGUI` se segurado `kc` se tocado | | LGUI = KC.HT(KC.SOMETHING, KC.LGUI) | `LGUI` se segurado `kc` se tocado |
| RCTL = KC.MT(KC.SOMETHING, KC.RCTRL) | `RCTRL` se segurado `kc` se tocado | | RCTL = KC.HT(KC.SOMETHING, KC.RCTRL) | `RCTRL` se segurado `kc` se tocado |
| RSFT = KC.MT(KC.SOMETHING, KC.RSFT) | `RSHIFT` se segurado `kc` se tocado | | RSFT = KC.HT(KC.SOMETHING, KC.RSFT) | `RSHIFT` se segurado `kc` se tocado |
| RALT = KC.MT(KC.SOMETHING, KC.RALT) | `RALT` se segurado `kc` se tocado | | RALT = KC.HT(KC.SOMETHING, KC.RALT) | `RALT` se segurado `kc` se tocado |
| RGUI = KC.MT(KC.SOMETHING, KC.RGUI) | `RGUI` se segurado `kc` se tocado | | RGUI = KC.HT(KC.SOMETHING, KC.RGUI) | `RGUI` se segurado `kc` se tocado |
| SGUI = KC.MT(KC.SOMETHING, KC.LSHFT(KC.LGUI)) | `LSHIFT` e `LGUI` se segurado `kc` se tocado | | SGUI = KC.HT(KC.SOMETHING, KC.LSHFT(KC.LGUI)) | `LSHIFT` e `LGUI` se segurado `kc` se tocado |
| LCA = KC.MT(KC.SOMETHING, KC.LCTRL(KC.LALT)) | `LCTRL` e `LALT` se segurado `kc` se tocado | | LCA = KC.HT(KC.SOMETHING, KC.LCTRL(KC.LALT)) | `LCTRL` e `LALT` se segurado `kc` se tocado |
| LCAG = KC.MT(KC.SOMETHING, KC.LCTRL(KC.LALT(KC.LGUI))) | `LCTRL` e `LALT` e `LGUI` se segurado `kc` se tocado | | LCAG = KC.HT(KC.SOMETHING, KC.LCTRL(KC.LALT(KC.LGUI))) | `LCTRL` e `LALT` e `LGUI` se segurado `kc` se tocado |
| MEH = KC.MT(KC.SOMETHING, KC.LCTRL(KC.LSFT(KC.LALT))) | `CTRL` e `LSHIFT` e `LALT` se segurado `kc` se tocado | | MEH = KC.HT(KC.SOMETHING, KC.LCTRL(KC.LSFT(KC.LALT))) | `CTRL` e `LSHIFT` e `LALT` se segurado `kc` se tocado |
| HYPR = KC.MT(KC.SOMETHING, KC.HYPR) | `LCTRL` e `LSHIFT` e `LALT` e `LGUI` se segurado `kc` if tapped | | HYPR = KC.HT(KC.SOMETHING, KC.HYPR) | `LCTRL` e `LSHIFT` e `LALT` e `LGUI` se segurado `kc` if tapped |

View File

@ -12,7 +12,7 @@ módulos oferecidos correntemente são;
- [Layers](layers.md): Acrescenta suporte a camadas (Tecla Fn) para permitir - [Layers](layers.md): Acrescenta suporte a camadas (Tecla Fn) para permitir
colocar bem mais teclas no seu teclado. colocar bem mais teclas no seu teclado.
- [ModTap](modtap.md): Acrescenta suporte para teclas modificadoras que agem - [HoldTap](holdtap.md): Acrescenta suporte para teclas modificadoras que agem
como teclas comuns ao serem tocadas, mas como modificadores quando seguradas. como teclas comuns ao serem tocadas, mas como modificadores quando seguradas.
- [Power](power.md): Economia de energia. Este é mais útil quando usando baterias. - [Power](power.md): Economia de energia. Este é mais útil quando usando baterias.
- [Split](split_keyboards.md): Teclados repartidos em dois. Tão ergonômicos! - [Split](split_keyboards.md): Teclados repartidos em dois. Tão ergonômicos!

View File

@ -2,6 +2,7 @@ from kmk.keys import make_argumented_key
from kmk.modules.holdtap import HoldTap, HoldTapKeyMeta from kmk.modules.holdtap import HoldTap, HoldTapKeyMeta
# Deprecation Notice: The `ModTap` class serves as an alias for `HoldTap` and will be removed in a future update. Please use `HoldTap` instead.
class ModTap(HoldTap): class ModTap(HoldTap):
def __init__(self): def __init__(self):
super().__init__() super().__init__()

View File

@ -1,64 +1,66 @@
import unittest import unittest
from kmk.keys import KC from kmk.keys import KC
from kmk.modules.holdtap import HoldTapRepeat from kmk.modules.holdtap import HoldTap, HoldTapRepeat
from kmk.modules.layers import Layers from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
from tests.keyboard_test import KeyboardTest from tests.keyboard_test import KeyboardTest
class TestHoldTap(unittest.TestCase): class TestHoldTap(unittest.TestCase):
def setUp(self):
KC.clear()
def test_holdtap(self): def test_holdtap(self):
keyboard = KeyboardTest( keyboard = KeyboardTest(
[Layers(), ModTap()], [Layers(), HoldTap()],
[ [
[KC.MT(KC.A, KC.LCTL), KC.LT(1, KC.B), KC.C, KC.D], [KC.HT(KC.A, KC.LCTL), KC.LT(1, KC.B), KC.C, KC.D],
[KC.N1, KC.N2, KC.N3, KC.N4], [KC.N1, KC.N2, KC.N3, KC.N4],
], ],
debug_enabled=False, debug_enabled=False,
) )
keyboard.test('MT tap behaviour', [(0, True), 100, (0, False)], [{KC.A}, {}]) keyboard.test('HT tap behaviour', [(0, True), 100, (0, False)], [{KC.A}, {}])
keyboard.test( keyboard.test(
'MT hold behaviour', [(0, True), 350, (0, False)], [{KC.LCTL}, {}] 'HT hold behaviour', [(0, True), 350, (0, False)], [{KC.LCTL}, {}]
) )
# TODO test multiple mods being held # TODO test multiple mods being held
# MT # HT
keyboard.test( keyboard.test(
'MT within tap time sequential -> tap behavior', 'HT within tap time sequential -> tap behavior',
[(0, True), 100, (0, False), (3, True), (3, False)], [(0, True), 100, (0, False), (3, True), (3, False)],
[{KC.A}, {}, {KC.D}, {}], [{KC.A}, {}, {KC.D}, {}],
) )
keyboard.test( keyboard.test(
'MT within tap time rolling -> hold behavior', 'HT within tap time rolling -> hold behavior',
[(0, True), 100, (3, True), 250, (0, False), (3, False)], [(0, True), 100, (3, True), 250, (0, False), (3, False)],
[{KC.LCTL}, {KC.LCTL, KC.D}, {KC.D}, {}], [{KC.LCTL}, {KC.LCTL, KC.D}, {KC.D}, {}],
) )
keyboard.test( keyboard.test(
'MT within tap time nested -> hold behavior', 'HT within tap time nested -> hold behavior',
[(0, True), 100, (3, True), (3, False), 250, (0, False)], [(0, True), 100, (3, True), (3, False), 250, (0, False)],
[{KC.LCTL}, {KC.LCTL, KC.D}, {KC.LCTL}, {}], [{KC.LCTL}, {KC.LCTL, KC.D}, {KC.LCTL}, {}],
) )
keyboard.test( keyboard.test(
'MT after tap time sequential -> hold behavior', 'HT after tap time sequential -> hold behavior',
[(0, True), 350, (0, False), (3, True), (3, False)], [(0, True), 350, (0, False), (3, True), (3, False)],
[{KC.LCTL}, {}, {KC.D}, {}], [{KC.LCTL}, {}, {KC.D}, {}],
) )
keyboard.test( keyboard.test(
'MT after tap time rolling -> hold behavior', 'HT after tap time rolling -> hold behavior',
[(0, True), 350, (3, True), (0, False), (3, False)], [(0, True), 350, (3, True), (0, False), (3, False)],
[{KC.LCTL}, {KC.LCTL, KC.D}, {KC.D}, {}], [{KC.LCTL}, {KC.LCTL, KC.D}, {KC.D}, {}],
) )
keyboard.test( keyboard.test(
'MT after tap time nested -> hold behavior', 'HT after tap time nested -> hold behavior',
[(0, True), 350, (3, True), (3, False), (0, False)], [(0, True), 350, (3, True), (3, False), (0, False)],
[{KC.LCTL}, {KC.LCTL, KC.D}, {KC.LCTL}, {}], [{KC.LCTL}, {KC.LCTL, KC.D}, {KC.LCTL}, {}],
) )
@ -117,13 +119,13 @@ class TestHoldTap(unittest.TestCase):
def test_holdtap_chain(self): def test_holdtap_chain(self):
keyboard = KeyboardTest( keyboard = KeyboardTest(
[ModTap()], [HoldTap()],
[ [
[ [
KC.N0, KC.N0,
KC.MT(KC.N1, KC.LCTL, tap_time=50), KC.HT(KC.N1, KC.LCTL, tap_time=50),
KC.MT(KC.N2, KC.LSFT, tap_interrupted=True, tap_time=50), KC.HT(KC.N2, KC.LSFT, tap_interrupted=True, tap_time=50),
KC.MT( KC.HT(
KC.N3, KC.N3,
KC.LALT, KC.LALT,
prefer_hold=False, prefer_hold=False,
@ -274,12 +276,12 @@ class TestHoldTap(unittest.TestCase):
def test_holdtap_repeat(self): def test_holdtap_repeat(self):
keyboard = KeyboardTest( keyboard = KeyboardTest(
[ModTap()], [HoldTap()],
[ [
[ [
KC.MT(KC.A, KC.B, repeat=HoldTapRepeat.ALL, tap_time=50), KC.HT(KC.A, KC.B, repeat=HoldTapRepeat.ALL, tap_time=50),
KC.MT(KC.A, KC.B, repeat=HoldTapRepeat.TAP, tap_time=50), KC.HT(KC.A, KC.B, repeat=HoldTapRepeat.TAP, tap_time=50),
KC.MT(KC.A, KC.B, repeat=HoldTapRepeat.HOLD, tap_time=50), KC.HT(KC.A, KC.B, repeat=HoldTapRepeat.HOLD, tap_time=50),
] ]
], ],
debug_enabled=False, debug_enabled=False,

View File

@ -88,7 +88,7 @@ class TestTapDance(unittest.TestCase):
[{KC.N1}, {KC.N1, KC.N4}, {KC.N4}, {}], [{KC.N1}, {KC.N1, KC.N4}, {KC.N4}, {}],
) )
def test_modtap(self): def test_holdtap(self):
keyboard = self.keyboard keyboard = self.keyboard
t_within = self.t_within t_within = self.t_within
t_after = self.t_after t_after = self.t_after
@ -199,12 +199,12 @@ class TestTapDance(unittest.TestCase):
[{KC.A}, {}, {KC.N5}, {}], [{KC.A}, {}, {KC.N5}, {}],
) )
def test_modtap_repeat(self): def test_holdtap_repeat(self):
keyboard = self.keyboard keyboard = self.keyboard
t_after = self.t_after t_after = self.t_after
keyboard.test( keyboard.test(
'ModTap repeat', 'HoldTap repeat',
[ [
(2, True), (2, True),
(2, False), (2, False),

View File

@ -2,8 +2,8 @@ from kb import KMKKeyboard
from kmk.extensions.rgb import RGB from kmk.extensions.rgb import RGB
from kmk.keys import KC from kmk.keys import KC
from kmk.modules.holdtap import HoldTap
from kmk.modules.layers import Layers from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
keyboard = KMKKeyboard() keyboard = KMKKeyboard()
@ -22,15 +22,15 @@ FN1 = 2
rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=16) rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=16)
layers_ext = Layers() layers_ext = Layers()
modtap = ModTap() holdtap = HoldTap()
keyboard.modules = [layers_ext, modtap] keyboard.modules = [layers_ext, holdtap]
keyboard.extensions = [rgb_ext] keyboard.extensions = [rgb_ext]
_______ = KC.TRNS _______ = KC.TRNS
XXXXXXX = KC.NO XXXXXXX = KC.NO
HOME = KC.MT(KC.HOME, KC.LSFT) HOME = KC.HT(KC.HOME, KC.LSFT)
END = KC.MT(KC.END, KC.RSFT) END = KC.HT(KC.END, KC.RSFT)
LEFT_LAY = KC.LT(FN1, KC.LEFT) LEFT_LAY = KC.LT(FN1, KC.LEFT)
SHFT_INS = KC.LSFT(KC.INS) SHFT_INS = KC.LSFT(KC.INS)
SPC = KC.LT(FN1, KC.SPC) SPC = KC.LT(FN1, KC.SPC)

View File

@ -5,8 +5,8 @@ from kb import KMKKeyboard
from kmk.extensions.rgb import RGB from kmk.extensions.rgb import RGB
from kmk.handlers.sequences import send_string, simple_key_sequence from kmk.handlers.sequences import send_string, simple_key_sequence
from kmk.keys import KC from kmk.keys import KC
from kmk.modules.holdtap import HoldTap
from kmk.modules.layers import Layers from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
from kmk.modules.split import Split from kmk.modules.split import Split
keyboard = KMKKeyboard() keyboard = KMKKeyboard()
@ -15,11 +15,11 @@ keyboard = KMKKeyboard()
keyboard.tap_time = 150 keyboard.tap_time = 150
layers = Layers() layers = Layers()
modtap = ModTap() holdtap = HoldTap()
rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=27, val_limit=100, hue_default=190, sat_default=100, val_default=5) rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=27, val_limit=100, hue_default=190, sat_default=100, val_default=5)
split = Split() split = Split()
keyboard.modules = [modtap, layers, split] keyboard.modules = [holdtap, layers, split]
keyboard.extensions = [rgb_ext] keyboard.extensions = [rgb_ext]
_______ = KC.TRNS _______ = KC.TRNS

View File

@ -35,7 +35,7 @@ keyboard.keymap = [
# Default # Default
KC.GESC, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.BSPC, KC.GESC, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.BSPC,
KC.TAB, KC.A, KC.S, KC.D, KC.F, KC.G, KC.H, KC.J, KC.K, KC.L, KC.SCLN, KC.QUOT, KC.TAB, KC.A, KC.S, KC.D, KC.F, KC.G, KC.H, KC.J, KC.K, KC.L, KC.SCLN, KC.QUOT,
KC.LSFT, KC.Z, KC.X, KC.C, KC.V, KC.B, KC.N, KC.M, KC.COMM, KC.DOT, KC.SLSH, KC.MT(KC.BSLS, KC.LSFT), KC.LSFT, KC.Z, KC.X, KC.C, KC.V, KC.B, KC.N, KC.M, KC.COMM, KC.DOT, KC.SLSH, KC.HT(KC.BSLS, KC.LSFT),
KC.LCTRL, KC.LGUI, KC.LALT, LOWER, KC.ENT, KC.SPC, KC.SPC, UP_HYP, KC.LEFT, KC.DOWN, KC.UP, KC.RGHT, KC.LCTRL, KC.LGUI, KC.LALT, LOWER, KC.ENT, KC.SPC, KC.SPC, UP_HYP, KC.LEFT, KC.DOWN, KC.UP, KC.RGHT,
], ],
[ [