Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
242 commits
Select commit Hold shift + click to select a range
6e20530
enable TAPPING_TOGGLE=1 to work correctly
Nov 26, 2015
1248971
Merge branch 'master' of github.com:tmk/tmk_keyboard
tmk Dec 5, 2015
fdc3c00
Remove an errant comma trailing the KC_ERAS macro alias
Dec 8, 2015
20d568c
Merge remote-tracking branch 'upstream/master' into chibios
flabbergast Dec 18, 2015
f3c7bbe
Chibios: add 'core/protocol' to the makefiles' search path.
flabbergast Dec 30, 2015
ef91781
host_driver is only used if KEYBOARD_LOCK_ENABLE is defined
obones Jan 7, 2016
7559ecf
usb_usb: Fix for keymap editor
tmk Jan 12, 2016
1adcf98
Fix typo in bootmagic debug message
shayneholmes Jan 12, 2016
d39ea9e
remove SERIAL_SOFT_DEBUG macro
duanhongyi Jan 14, 2016
2cd9600
core: Fix doc/build.md
tmk Jan 15, 2016
afcdb68
core: Add dfu-programmer example to doc/build.md
tmk Jan 15, 2016
6e1746c
Add support for storing, restoring and clearing modifiers in macros
p3lim Oct 23, 2015
550fca1
core: Add macro commands SM(), RM() and CM()
tmk Jan 15, 2016
c9b2157
Merge pull request #295 from doopai/master
tmk Jan 15, 2016
c20cd19
Merge pull request #294 from shayneholmes/fix-debug-message
tmk Jan 15, 2016
0d3ac25
Merge pull request #292 from obones/command_warning
tmk Jan 15, 2016
37a1dd8
core: Fix variable init and header include
tmk Jan 15, 2016
8eb0923
core: Fix variable initialize
tmk Jan 15, 2016
d7b8591
Merge branch 'master' into chibios
flabbergast Jan 15, 2016
655a6d0
Chibios: Update to new USB API.
flabbergast Jan 15, 2016
07bce84
core: Add note about sudo and git
tmk Jan 16, 2016
26161d2
Merge pull request #230 from jerryen/master
tmk Jan 16, 2016
0057419
Merge remote-tracking branch 'upstream/master' into chibios
flabbergast Jan 18, 2016
777176c
core: Speed up compilation
kairyu Jan 22, 2016
eafd2f5
Chibios: add more guards for transmitting (fix a deadlock bug).
flabbergast Jan 22, 2016
ba0a1cf
core: Remove unused warning. Fix tmk_keyboard/#293
tmk Jan 26, 2016
c51dff4
Merge remote-tracking branch 'flabbergast-tmk_keyboard/chibios'
tmk Feb 9, 2016
d729c4b
Merge commit '28203e909e83b1ac6becb45a3eadae23b190df32' into master-c…
tmk Feb 11, 2016
3f5afdd
Chibios: Fix a HardFault bug (wait after start).
flabbergast Feb 11, 2016
53a1b0c
Chibios: cleanup usb_main code.
flabbergast Feb 11, 2016
fa5604f
Merge commit '5a0132f1c1c9a14fd2941f0a5e29bbf5e31da20c' into master-c…
tmk Feb 12, 2016
b1f18cb
Chibios: Revert common.mk change (fix AVR linking problem).
flabbergast Feb 13, 2016
f5b0093
Merge commit '657d9f23fe47fb88cf221adb23095082f191ba6a'
tmk Feb 16, 2016
a4b7dd6
Removed duplicate debug message code and surrounded it with IFDEF as …
obones Feb 10, 2016
864612f
core: Fix ps2_mouse.c debug print
tmk Feb 16, 2016
c9cba73
Merge branch 'chibios' of https://github.com/flabbergast/tmk_keyboard…
tmk Feb 17, 2016
fe62498
core: Fix chibios user compile options
tmk Feb 17, 2016
211bdbb
Codes appear to be detected correctly, the break codes are broken.
papodaca Mar 2, 2016
a7557eb
core: Actionmap support
tmk Mar 3, 2016
d03a790
Mostly working. Is unstable, will emit bad codes after a while.
papodaca Mar 3, 2016
eac46d8
ps2_usb: Fix for VUSB configuration
tmk Mar 18, 2016
b6d80e8
clarify layer documentation
njbair Mar 27, 2016
5105d0f
Clarify layer precedence
njbair Mar 27, 2016
1c04b83
Clean up wording in keymap example
njbair Mar 27, 2016
42491bf
core: Fix media/consumer keys
tmk Mar 28, 2016
b4c3cbe
Merge pull request #321 from njbair/master
tmk Mar 28, 2016
5233dea
Merge commit '71381457fa1311dfa0b58ba882a96db740640871'
tmk Apr 21, 2016
04c7068
update macro names in bluefruit
esell May 5, 2016
487da43
core: Add adb_host_talk()
tmk May 19, 2016
a0e4eb4
core: Add comment of register 3 of ADB
tmk May 20, 2016
0faf095
Merge commit '20b787fc1284176834cbe7ca2134e4b36bec5828'
tmk May 22, 2016
1178192
core: change API of adb.c to accept device address
tmk Jun 4, 2016
28b5d5f
Merge pull request #355 from papodaca/XT
tmk Jun 4, 2016
66e2af1
core: Fix LUFA report descriptor
tmk Jun 5, 2016
0763a41
core: Fix Logical Maximum in report descriptor
tmk Jun 7, 2016
20ff656
usb_usb: Add multiple keyboard support
tmk Jun 21, 2016
2722a92
core: Fix USB remote wakeup on ATmega32U2 #361
tmk Jun 15, 2016
0968fb1
core: Fix keycode.txt
tmk Jul 30, 2016
106f4bc
core: Change chibios repo directory names
tmk Aug 8, 2016
c372195
core: action codes are action_t struct now
tmk Mar 29, 2016
85d1048
core: Add default implemenation of keymap read
tmk Jun 25, 2016
a56a580
core: Fix doc/keymap.md for new keymap framework
tmk Jun 26, 2016
b468036
core: Add unimap support
tmk Jun 29, 2016
2157ca7
core: Fix unimap layout comment
tmk Aug 30, 2016
b5a3a03
core: Fix common.mk for build options
tmk Aug 31, 2016
bd07b62
core: Change lufa NKRO report size 16 to 32 bytes
tmk Sep 6, 2016
98f50a7
core: Fix unimap UNIMAP_NO case
tmk Sep 8, 2016
170bce2
core: 'make dfu' waits for bootloader to start
tmk Sep 8, 2016
234be45
Fix OS X Recognizing keyboard as Mouse/Tablet
exiva Jul 15, 2016
5ff299c
core: Fix 'make dfu' message
tmk Sep 8, 2016
539f703
Merge branch 'mediakey-fix'
tmk Sep 8, 2016
5391df8
core: Fix dfu wait in rules.mk
tmk Sep 9, 2016
90844eb
core: Add short names in unimap
tmk Sep 9, 2016
4e88ae7
core: Fix build config in protocol.mk
tmk Sep 16, 2016
dd09c54
Change .gitignore for ChibiOS
leizzer Sep 22, 2016
c86b65a
Merge branch 'master' of github.com:leizzer/tmk_keyboard
leizzer Sep 22, 2016
0cf4708
core: Fix OPT_DEFS for mbed build
tmk Sep 24, 2016
a140e0c
Merge branch 'nemith-master'
tmk Sep 24, 2016
a1ea074
core: Fix mechanical locking supoort #390
tmk Sep 25, 2016
8627cb2
core: LUFA_DEBUG_SUART for serial debug
tmk Sep 28, 2016
ce2fc6d
core: Fix suspend/wake for converters #386
tmk Sep 28, 2016
7b0e4af
core: Add suspend mode options
tmk Oct 4, 2016
34fd281
core: Add matrix_clear() and default impl.
tmk Oct 5, 2016
5c870f4
core: Change matrix_init and matrix_print
tmk Oct 8, 2016
11ae4c6
core: Fix sleep_led
tmk Oct 12, 2016
303ec7d
core: Debug print for system and consumer keys
tmk Oct 18, 2016
05113a6
core: Fix typo in definition AC_g
39aldo39 Nov 14, 2016
e135d9d
V-USB remote wakeup
luizribeiro Nov 27, 2016
0d58b13
Merge pull request #406 from 39aldo39/patch-1
tmk Nov 29, 2016
b5d4696
core: Swap position of PEQL and PENT in unimap
tmk Oct 24, 2016
381eaf5
Add in basic documentation for Macro system
tanant Dec 4, 2016
c2b28ce
Add note for L/R side bit being ignored
tanant Dec 4, 2016
4127ef4
Merge commit '22b6e15a179031afb7c3534cf7b109b0668b602c'
tmk Dec 10, 2016
9401da5
core: Fix for ChibiOS update #411
tmk Dec 2, 2016
fcb2a26
core: Modifiers can be used as tap key Fix #422
tmk Jan 4, 2017
a31bcc1
core: Cancel removing IS_ANY() at c98e89f
tmk Jan 5, 2017
7fe55b9
core: Fix LAYER_MODS() and LAYER_TAP()
tmk Jan 11, 2017
418f490
core: Add MOD_NONE to mods_bit enum
tmk Feb 2, 2017
442d494
core: Fix for missing key on fc660c
tmk Apr 10, 2017
2cbce85
core: Change MOD_* definition to make OR(|) usable
tmk Apr 11, 2017
afcda99
core: Fix typo
tmk Apr 11, 2017
9b44118
core: Fix for stuck key problem #441
tmk May 26, 2017
088d576
core: Fix Oneshot mods key repeat problem #474
tmk May 30, 2017
5617648
remove unused functions
TheMatrixHasYouException Jun 24, 2017
75f747e
core: Fix dfu-programmer version check
tmk Sep 7, 2017
4743ab2
core: Fix for ATtiny85
tmk Sep 14, 2017
6a3ee32
core: Fix for build option NO_ACTION_LAYER
tmk Sep 14, 2017
9bc51e1
core: Remove unused file in vusb
tmk Sep 14, 2017
e80a587
Fix for ChibiOS Update tmk/tmk_keyboard#411
Oct 15, 2017
1087c13
Move all ChibiOS install documentation to once place
mtfurlan Oct 15, 2017
45d350c
core: Fix out-of-bounds access by TICK event #487
tmk Oct 21, 2017
c15d6a1
core: Fix doc/keymap.md for bitwise operation
tmk Oct 26, 2017
59a995e
fix not correctly showing 32u2 warning message when Endpints are more…
yangdigi Jan 3, 2018
f38a930
core: LUFA: Fix checking num of endpoints for 32u2
tmk Jan 4, 2018
de78b4b
Revert "core: LUFA: Fix checking num of endpoints for 32u2"
tmk Jan 4, 2018
2fa345b
core: lufa: Fix checking num of endpoints for 32u2(again)
tmk Jan 4, 2018
0e08155
core: Fix for warning of unused label. #515
tmk Jan 13, 2018
b30d2c3
core: Fix for warning of unused function standby()
tmk Jan 13, 2018
cd0db15
core: Fix for unused function when compiling without MOUSEKEY_ENABLE
alex-ong Jan 22, 2018
95e0c99
core: Fix for un-defined function when compiling without MOUSEKEY_ENABLE
alex-ong Jan 22, 2018
f26b74e
Typos (#524)
alex-ong Jan 23, 2018
f0c8b99
core: Saved 60~ bytes (and possible performance) by storing col_mask …
alex-ong Jan 24, 2018
c49bc10
core: Typo (mantrix -> matrix)
alex-ong Jan 26, 2018
d02701f
core: Add utility type_code() in aciton.h #528
tmk Jan 28, 2018
51d78ca
core: Add utility macros in action_macro.h (#532)
DreymaR Jan 28, 2018
0f44384
core: lufa: Add delay for console startup
tmk Mar 1, 2018
799af83
xt_usb: read data on falling edge soft/hard reset
tmk Feb 28, 2018
a973dea
xt_usb: Read data earlier as possible in ISR
tmk Mar 1, 2018
485ccda
xt_usb: Comment out clock check for PCINT
tmk Mar 2, 2018
da5a482
xt_usb: Replace functions with macros
tmk Mar 2, 2018
a422d51
xt_usb: Fix warning on switch-case
tmk Mar 2, 2018
e374661
xt_usb: Remove xt_io.h
tmk Mar 2, 2018
b94a961
xt_usb: Replace function with macro
tmk Mar 2, 2018
fc56db4
tmk_core: Now expects dfu-programmer 0.7 or later
tmk May 17, 2018
302c881
rule.mk: Add dfu-programmer version check again
tmk Jul 5, 2018
a2d06a8
usb_usb: Add Cheery 0101010101010101 bug fix
tmk Jul 14, 2018
66abfdd
core: Add ring buffer file
tmk Jul 25, 2018
acedbf4
core: lufa: Fix console output and init sequence
tmk Sep 10, 2018
4c8d491
core: lufa: Fix timeout of send_keyboard
tmk Sep 20, 2018
94fc110
core: lufa: Fix wait for console startup
tmk Sep 23, 2018
8411a4b
xt_usb: Change ring buffer and control Data line
tmk Sep 10, 2018
3439a9d
core: Update console startup for hid_listen
tmk Oct 15, 2018
b5b3fc8
Fix header guard in tmk_core/common/command.h (#581)
vomindoraan Oct 31, 2018
5542f5d
lufa: usb-usb: Use LUFA startup instead of cusotom
tmk Oct 28, 2018
968eeca
usb_hid: Remove USB_Host_Shield_2.0
tmk Oct 30, 2018
84d28c6
usb_hid: Add USB_Host_Shield_2.0 submodule
tmk Oct 30, 2018
beb27f9
usb_usb: usb_hid: Change for USB_Host_Shield_2.0
tmk Oct 30, 2018
98c7d39
make some change to complie stm32_f103_onekey with new version of Chi…
rxy0424 Nov 6, 2018
753f7b0
core: System control key descriptor fix #435
tmk Jan 25, 2019
5f1e703
Correct two errors of keycode.txt (#594)
youxiaojie Mar 12, 2019
58d4d2a
Correct typo for linux "showkey" command (#603)
youxiaojie Mar 17, 2019
6eb2ece
core: Fix uart.c for ATmega32U4
tmk Mar 22, 2019
5144edb
lufa: Add debug print support with UART
tmk Mar 26, 2019
afb66a3
lufa: This prevents resume when debug
tmk Mar 31, 2019
321edf9
lufa: Fix for UART debug print
tmk Apr 26, 2019
617e7fe
core: Avoid deadlock when uart.c is used in ISR
tmk May 2, 2019
2228535
lufa: Fix Change debug print message
tmk May 6, 2019
e646a5c
lufa: Fix for freeze at re/boot time problem
tmk Mar 29, 2019
2bb39cc
usb_hid: Change to USB_Host_Shield_2.0 of tmk repo
tmk May 6, 2019
6f46be0
lufa:usb_usb: matrix_scan() is no longer needed
tmk May 5, 2019
ec94691
lufa: Startup and suspend loop can be disabled
tmk May 7, 2019
2e1c26a
core: Add hook_usb_startup_wait_loop
tmk May 8, 2019
26abe5d
usb_usb: Handle Rollover error
tmk May 10, 2019
7fb7960
lufa: Print TMK version to console
tmk May 29, 2019
7ad8513
core: Add hook_process_action()
tmk May 29, 2019
d55207d
core:adb_usb: Add Extended Mouse Protocol support #274
tmk Jun 21, 2019
dc8c3d8
adb_usb: Fix mouse_init
tmk Jun 23, 2019
4acc276
core: Fix ibm4704_send() wait for clock to start
tmk Jul 12, 2019
437115b
Merge pull request #29 from lactide/fix_for_chibios_update
tmk Jul 31, 2019
9cd7ae4
core: Add bootkey of Caterina bootloader
tmk Sep 16, 2019
46d45d6
core: Fix comment and remove unused code
tmk Sep 16, 2019
0d98300
core: Read bootloader size from AVR fuse bits
tmk Sep 17, 2019
725a9fe
core: Add AC_BTLD to actionmap and unimap
tmk Sep 17, 2019
57c4260
core: Remove unneeded code in bootloader_jump
tmk Sep 18, 2019
486399b
core: Add NO_PRINT and NO_DEBUG build option
tmk Sep 18, 2019
b1eaaa3
usb_usb: Clean print for debug
tmk Sep 18, 2019
5a2ffa2
core: Add short name for keycode KP_00 and KP_000
tmk Nov 12, 2019
626fa8a
core: Add IBM PC Keyboard protocol support
tmk Dec 4, 2019
f639093
core: Add ldscript for AT90USB to support unimap
tmk Dec 4, 2019
5f326f0
core: Fix ldscript for AT90USB to support unimap
tmk Dec 4, 2019
29a8045
core: Fix bootloader for 128KB flash
tmk Dec 4, 2019
43a8630
core: Fix unimap translation range
tmk Feb 3, 2020
4b96b04
lufa: Fix console_putc
tmk Feb 7, 2020
27f9f8f
lufa: Remove old LUFA directory
tmk Feb 8, 2020
43c325c
lufa: Use the latest LUFA library on github
tmk Feb 8, 2020
404f7c8
lufa: Update makefile for new LUFA
tmk Feb 8, 2020
172658f
lufa: Rename LUFA_DEBUG to TMK_LUFA_DEBUG
tmk Feb 9, 2020
2140622
ibmpc: Read data line earlier in ISR as possible
tmk Jan 11, 2020
88c22a0
ibmpc: Fix START case in ISR
tmk Jan 11, 2020
8e4a0a0
ibmpc: Add intruppt disable and enable function
tmk Jan 17, 2020
1774cc3
ibmpc: Add ibmpc_host_clear_isr
tmk Jan 22, 2020
10306aa
ibmpc: Change ISR code
tmk Jan 23, 2020
7d821fa
ibmpc_usb: Fix hard reset code
tmk Jan 23, 2020
1890754
ibmpc: Fix stop bit check code in ISR
tmk Jan 23, 2020
5e4cd34
ibmpc: Add two-byte buffer for data received
tmk Jan 23, 2020
e2417a7
ibmpc: Fix debug print and wait time
tmk Jan 24, 2020
3aa090e
ibmpc: Refactor code
tmk Jan 24, 2020
4b6b977
ibmpc: Add timeout check
tmk Mar 1, 2020
b5824d6
ibmpc: Fix comments
tmk Mar 1, 2020
2f45709
ibmpc: Check buffer full and error code FF
tmk Mar 1, 2020
c7eaf49
ibmpc: Protocol detection between AT and XT
tmk Mar 2, 2020
4823964
ibmpc: Fix debug print
tmk Mar 2, 2020
ea471fe
lufa: Disable SOF interrupt
tmk Mar 20, 2020
63db522
lufa: Add comment on INTERRUPT_CONTROL_ENDPOINT
tmk Mar 20, 2020
c59d0dc
tmk_core/common/timer.h: Fixing TIMER_DIFF macro to calculate differe…
purdeaandrei Apr 1, 2020
be13d65
tmk_core/common/timer.h: Improve code generation for TIMER_DIFF* macros
purdeaandrei Apr 1, 2020
bac0317
core: Add 'dude' makefile target for avrdude
tmk May 6, 2020
996c2de
core: ibmpc: Add comments on stop bit of Z-150 AT
tmk May 8, 2020
07f7628
core: ibmpc: Check response of set indicator command
tmk May 8, 2020
65c5bb1
lufa: Fix comment on INTERRUPT_CONTROL_ENDPOINT
tmk Mar 28, 2020
8cd9fac
ibmpc: Add handling for erroneous start bit XT(IBM)
tmk Mar 22, 2020
3d967ea
ibmpc: Add ibmpc_isr_debug to see isr_state
tmk May 11, 2020
302a438
ibmpc: Update ERR_FF, ERR_FULL handling
tmk May 10, 2020
cfe8821
core: Add HID usage for Display Brightness Control
tmk May 11, 2020
efbc604
ibmpc: Fix Timeout error
tmk May 12, 2020
3721cf8
ibmpc: Fix buffer full check
tmk May 12, 2020
18f7899
ibmpc: Add debug code for isr_state
tmk May 12, 2020
d503070
ibmpc: Fix ibmpc_host_isr_clear()
tmk May 12, 2020
ba51ddb
ibmpc_usb: Add 'protocol change detection'
tmk May 12, 2020
f611409
ibmpc: Fix AT 'request to send' signaling
tmk May 13, 2020
7fd4a22
ibmpc: Fix 'Ack' check of sending data
tmk May 8, 2020
558ca4e
ibmpc: Add Z-150 AT protocol recognition
tmk May 13, 2020
5b5a268
core: Make TIMER0 ISR noblock
tmk May 21, 2020
dba90a4
core: Add default impl for led_set()
tmk May 30, 2020
461feb9
core: Fix matrix_print()
tmk Jun 1, 2020
1d8d3ca
ibmpc: Change timeout period: 1.0ms to 2.0ms
tmk Jul 5, 2020
f23fd3b
vusb: Fix keyboard_protocol and keyboard_idle #547
tmk Jul 27, 2020
16f1a54
xt_usb: Fix XT soft reset
tmk Oct 26, 2020
3a98ce9
ibmpc: Fix XT reset comment and add inhibit_xt()
tmk Oct 26, 2020
08ed78c
usb_hid: Delete arduino cores 1.0.1
tmk Oct 26, 2020
f5916b4
usb_hid: Update arduino cores to 1.8.13
tmk Oct 26, 2020
725422f
usb_hid: Update and fix USB Host Shield lib
tmk Oct 31, 2020
1dbd075
core: Clean up code of Locking key support
tmk Nov 7, 2020
ac9cae4
core: Fix TAP_KEY(CapsLock) for MacOS #659
tmk Nov 7, 2020
160e2d1
ibmpc: Add adhoc fix for Z-150 AT send
tmk Nov 16, 2020
aff41e9
usb_usb: Update USB_Host_Shield_2.0
tmk Dec 24, 2020
315bfa5
core: Update comments in keycode.h
tmk Jan 24, 2021
79c987d
English correction (#668)
oliverdelancey Jan 30, 2021
1b3fe95
core: Fix is_tap_key() #673
tmk Feb 8, 2021
8bfaa6c
Merge branch 'core_210209'
tmk Feb 10, 2021
f47682b
Add LUFA and UHS2 as submodule
tmk Feb 10, 2021
c3a73d1
Merge remote-tracking branch 'tmk-main/master' into HEAD
gompa Mar 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "protocol/usb_hid/USB_Host_Shield_2.0-tmk"]
path = protocol/usb_hid/USB_Host_Shield_2.0-tmk
url = https://github.com/tmk/USB_Host_Shield_2.0.git
[submodule "protocol/lufa/lufa-abcminiuser"]
path = protocol/lufa/lufa-abcminiuser
url = https://github.com/abcminiuser/lufa.git
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ Source code is available here: <https://github.com/tmk/tmk_keyboard/tree/core>

Updates
-------
#### 2017/05/30
Fixed **Modifier/Layer key stuck** problem. See this wiki entry. <https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#modifierlayer-stuck> If you need old keymap behaviour for some reason define `NO_TRACK_KEY_PRESS` in your `config.h`.

This is virtually equivalent to QMK `PREVENT_STUCK_MODIFIERS`. <https://github.com/qmk/qmk_firmware/pull/182>

#### 2017/01/11
Changed action code for `ACTION_LAYER_MODS` and this may cause incompatibility with existent shared URL and downloaded firmwware of keymap editor. If you are using the action you just have to redefine it on keymap editor. Existent keymap code should not suffer.

#### 2016/06/26
Keymap framework was updated. `fn_actions[]` should be defined as `action_t` instead of `uint16_t`. And default code for keymap handling is now included in core you just need define `uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]` and `action_t fn_actions[]`.

Expand Down
21 changes: 18 additions & 3 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ SRC += $(COMMON_DIR)/host.c \
ifeq (yes,$(strip $(UNIMAP_ENABLE)))
SRC += $(COMMON_DIR)/unimap.c
OPT_DEFS += -DUNIMAP_ENABLE
OPT_DEFS += -DACTIONMAP_ENABLE
else
ifeq (yes,$(strip $(ACTIONMAP_ENABLE)))
SRC += $(COMMON_DIR)/actionmap.c
Expand Down Expand Up @@ -49,10 +50,22 @@ endif
ifeq (yes,$(strip $(CONSOLE_ENABLE)))
OPT_DEFS += -DCONSOLE_ENABLE
else
OPT_DEFS += -DNO_PRINT
# Remove print functions when console is disabled and
# no other print method like UART is available
ifneq (yes, $(strip $(DEBUG_PRINT_AVAILABLE)))
OPT_DEFS += -DNO_PRINT
OPT_DEFS += -DNO_DEBUG
endif
endif

ifeq (yes,$(strip $(NO_DEBUG)))
OPT_DEFS += -DNO_DEBUG
endif

ifeq (yes,$(strip $(NO_PRINT)))
OPT_DEFS += -DNO_PRINT
endif

ifeq (yes,$(strip $(COMMAND_ENABLE)))
SRC += $(COMMON_DIR)/command.c
OPT_DEFS += -DCOMMAND_ENABLE
Expand Down Expand Up @@ -88,14 +101,16 @@ ifeq (yes,$(strip $(KEYMAP_SECTION_ENABLE)))
EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x
else ifeq ($(strip $(MCU)),atmega32u4)
EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x
else ifeq ($(strip $(MCU)),at90usb1286)
EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr51.x
else
EXTRALDFLAGS = $(error no ldscript for keymap section)
endif
endif

# Version string
VERSION := $(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null)
OPT_DEFS += -DVERSION=$(VERSION)
TMK_VERSION := $(shell (git describe --always --dirty=+ || echo 'unknown') 2> /dev/null)
OPT_DEFS += -DTMK_VERSION=$(TMK_VERSION)


# Search Path
Expand Down
163 changes: 97 additions & 66 deletions common/action.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
Copyright 2012,2013,2020 Jun Wako <wakojun@gmail.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -28,6 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "action.h"
#include "hook.h"
#include "wait.h"
#include "bootloader.h"

#ifdef DEBUG_ACTION
#include "debug.h"
Expand Down Expand Up @@ -58,14 +59,16 @@ void action_exec(keyevent_t event)

void process_action(keyrecord_t *record)
{
if (hook_process_action(record)) return;

keyevent_t event = record->event;
#ifndef NO_ACTION_TAPPING
uint8_t tap_count = record->tap.count;
#endif

if (IS_NOEVENT(event)) { return; }

action_t action = layer_switch_get_action(event.key);
action_t action = layer_switch_get_action(event);
dprint("ACTION: "); debug_action(action);
#ifndef NO_ACTION_LAYER
dprint(" layer_state: "); layer_debug();
Expand Down Expand Up @@ -101,7 +104,7 @@ void process_action(keyrecord_t *record)
{
uint8_t mods = (action.kind.id == ACT_LMODS_TAP) ? action.key.mods :
action.key.mods<<4;
switch (action.layer_tap.code) {
switch (action.key.code) {
#ifndef NO_ACTION_ONESHOT
case MODS_ONESHOT:
// Oneshot modifier
Expand Down Expand Up @@ -160,6 +163,13 @@ void process_action(keyrecord_t *record)
} else {
dprint("MODS_TAP: Tap: register_code\n");
register_code(action.key.code);

// Delay for MacOS #659
if (action.key.code == KC_CAPSLOCK ||
action.key.code == KC_NUMLOCK ||
action.key.code == KC_SCROLLLOCK) {
wait_ms(100);
}
}
} else {
dprint("MODS_TAP: No tap: add_mods\n");
Expand Down Expand Up @@ -247,14 +257,18 @@ void process_action(keyrecord_t *record)
case ACT_LAYER_TAP:
case ACT_LAYER_TAP_EXT:
switch (action.layer_tap.code) {
case 0xe0 ... 0xef:
/* layer On/Off with modifiers(left only) */
case 0xc0 ... 0xdf:
/* layer On/Off with modifiers */
if (event.pressed) {
layer_on(action.layer_tap.val);
register_mods(action.layer_tap.code & 0x0f);
register_mods((action.layer_tap.code & 0x10) ?
(action.layer_tap.code & 0x0f) << 4 :
(action.layer_tap.code & 0x0f));
} else {
layer_off(action.layer_tap.val);
unregister_mods(action.layer_tap.code & 0x0f);
unregister_mods((action.layer_tap.code & 0x10) ?
(action.layer_tap.code & 0x0f) << 4 :
(action.layer_tap.code & 0x0f));
}
break;
case OP_TAP_TOGGLE:
Expand Down Expand Up @@ -287,6 +301,13 @@ void process_action(keyrecord_t *record)
if (tap_count > 0) {
dprint("KEYMAP_TAP_KEY: Tap: register_code\n");
register_code(action.layer_tap.code);

// Delay for MacOS #659
if (action.layer_tap.code == KC_CAPSLOCK ||
action.layer_tap.code == KC_NUMLOCK ||
action.layer_tap.code == KC_SCROLLLOCK) {
wait_ms(100);
}
} else {
dprint("KEYMAP_TAP_KEY: No tap: On on press\n");
layer_on(action.layer_tap.val);
Expand Down Expand Up @@ -335,6 +356,15 @@ void process_action(keyrecord_t *record)
break;
#endif
case ACT_COMMAND:
switch (action.command.id) {
case COMMAND_BOOTLOADER:
if (event.pressed) {
clear_keyboard();
wait_ms(50);
bootloader_jump();
}
break;
}
break;
#ifndef NO_ACTION_FUNCTION
case ACT_FUNCTION:
Expand All @@ -359,37 +389,28 @@ void register_code(uint8_t code)
}

#ifdef LOCKING_SUPPORT_ENABLE
else if (KC_LOCKING_CAPS == code) {
#ifdef LOCKING_RESYNC_ENABLE
// Resync: ignore if caps lock already is on
if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) return;
#endif
add_key(KC_CAPSLOCK);
send_keyboard_report();
wait_ms(100);
del_key(KC_CAPSLOCK);
send_keyboard_report();
}

else if (KC_LOCKING_NUM == code) {
#ifdef LOCKING_RESYNC_ENABLE
if (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) return;
#endif
add_key(KC_NUMLOCK);
send_keyboard_report();
wait_ms(100);
del_key(KC_NUMLOCK);
send_keyboard_report();
}

else if (KC_LOCKING_SCROLL == code) {
else if (code == KC_LOCKING_CAPS ||
code == KC_LOCKING_NUM ||
code == KC_LOCKING_SCROLL) {
uint8_t c, l;
if (code == KC_LOCKING_CAPS) {
c = KC_CAPSLOCK;
l = 1<<USB_LED_CAPS_LOCK;
} else if (code == KC_LOCKING_NUM) {
c = KC_NUMLOCK;
l = 1<<USB_LED_NUM_LOCK;
} else if (code == KC_LOCKING_SCROLL) {
c = KC_SCROLLLOCK;
l = 1<<USB_LED_SCROLL_LOCK;
}
#ifdef LOCKING_RESYNC_ENABLE
if (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) return;
// Resync: ignore if lock indicator is already on
if (host_keyboard_leds() & l) return;
#endif
add_key(KC_SCROLLLOCK);
add_key(c);
send_keyboard_report();
wait_ms(100);
del_key(KC_SCROLLLOCK);
wait_ms(100); // Delay for MacOS #390
del_key(c);
send_keyboard_report();
}
#endif
Expand Down Expand Up @@ -437,37 +458,28 @@ void unregister_code(uint8_t code)
}

#ifdef LOCKING_SUPPORT_ENABLE
else if (KC_LOCKING_CAPS == code) {
#ifdef LOCKING_RESYNC_ENABLE
// Resync: ignore if caps lock already is off
if (!(host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK))) return;
#endif
add_key(KC_CAPSLOCK);
send_keyboard_report();
wait_ms(100);
del_key(KC_CAPSLOCK);
send_keyboard_report();
}

else if (KC_LOCKING_NUM == code) {
#ifdef LOCKING_RESYNC_ENABLE
if (!(host_keyboard_leds() & (1<<USB_LED_NUM_LOCK))) return;
#endif
add_key(KC_NUMLOCK);
send_keyboard_report();
wait_ms(100);
del_key(KC_NUMLOCK);
send_keyboard_report();
}

else if (KC_LOCKING_SCROLL == code) {
else if (code == KC_LOCKING_CAPS ||
code == KC_LOCKING_NUM ||
code == KC_LOCKING_SCROLL) {
uint8_t c, l;
if (code == KC_LOCKING_CAPS) {
c = KC_CAPSLOCK;
l = 1<<USB_LED_CAPS_LOCK;
} else if (code == KC_LOCKING_NUM) {
c = KC_NUMLOCK;
l = 1<<USB_LED_NUM_LOCK;
} else if (code == KC_LOCKING_SCROLL) {
c = KC_SCROLLLOCK;
l = 1<<USB_LED_SCROLL_LOCK;
}
#ifdef LOCKING_RESYNC_ENABLE
if (!(host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK))) return;
// Resync: ignore if lock indicator is already off
if (!(host_keyboard_leds() & l)) return;
#endif
add_key(KC_SCROLLLOCK);
add_key(c);
send_keyboard_report();
wait_ms(100);
del_key(KC_SCROLLLOCK);
wait_ms(100); // Delay for MacOS #390
del_key(c);
send_keyboard_report();
}
#endif
Expand All @@ -488,6 +500,12 @@ void unregister_code(uint8_t code)
}
}

void type_code(uint8_t code)
{
register_code(code);
unregister_code(code);
}

void register_mods(uint8_t mods)
{
if (mods) {
Expand Down Expand Up @@ -525,18 +543,31 @@ void clear_keyboard_but_mods(void)
#endif
}

bool is_tap_key(keypos_t key)
bool is_tap_key(keyevent_t event)
{
action_t action = layer_switch_get_action(key);
if (IS_NOEVENT(event)) { return false; }

action_t action = layer_switch_get_action(event);

switch (action.kind.id) {
case ACT_LMODS_TAP:
case ACT_RMODS_TAP:
switch (action.key.code) {
case MODS_ONESHOT:
case MODS_TAP_TOGGLE:
default: // tap key
return true;
}
case ACT_LAYER_TAP:
case ACT_LAYER_TAP_EXT:
switch (action.layer_tap.code) {
case 0x00 ... 0xdf:
case OP_ON_OFF:
case OP_OFF_ON:
case OP_SET_CLEAR:
case 0xc0 ... 0xdf: // with modifiers
return false;
case OP_TAP_TOGGLE:
default: // tap key
return true;
}
return false;
Expand Down
3 changes: 2 additions & 1 deletion common/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt);
void process_action(keyrecord_t *record);
void register_code(uint8_t code);
void unregister_code(uint8_t code);
void type_code(uint8_t code);
void register_mods(uint8_t mods);
void unregister_mods(uint8_t mods);
//void set_mods(uint8_t mods);
void clear_keyboard(void);
void clear_keyboard_but_mods(void);
void layer_switch(uint8_t new_layer);
bool is_tap_key(keypos_t key);
bool is_tap_key(keyevent_t event);

/* debug */
void debug_event(keyevent_t event);
Expand Down
Loading