From 628a48c7887e20a69b5a8c84cff956ba2ec7fed2 Mon Sep 17 00:00:00 2001 From: npoirey Date: Fri, 7 Oct 2016 17:18:19 +0200 Subject: Updated Readme to help windows users use docker for build --- readme.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'readme.md') diff --git a/readme.md b/readme.md index a7320202b..db118f9a3 100644 --- a/readme.md +++ b/readme.md @@ -140,6 +140,9 @@ If this is a bit complex for you, Docker might be the turn-key solution you need docker run -e keymap=gwen -e keyboard=ergodox --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware +# On windows docker seems to have issue with VOLUME tag in Dockerfile, and $('pwd') won't print a windows compliant path, use full path instead like this +docker run -e keymap=default -e keyboard=ergobop --rm -v D:/Users/Sacapuces/Documents/Repositories/qmk:/qmk:rw edasque/qmk_firmware + ``` This will compile the targetted keyboard/keymap and leave it in your QMK directory for you to flash. -- cgit v1.2.3 From 70f32842e5d94f14d05c1f9adcb1b1144a25a132 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Sun, 9 Oct 2016 12:52:39 +0200 Subject: Reduce the default dynamic macro buffer There have been reports of it leaving not enough free memory preventing the keyboard from working properly. --- quantum/dynamic_macro.h | 9 +++++++-- readme.md | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'readme.md') diff --git a/quantum/dynamic_macro.h b/quantum/dynamic_macro.h index a3ad61bc7..e6dbc5b9c 100644 --- a/quantum/dynamic_macro.h +++ b/quantum/dynamic_macro.h @@ -8,8 +8,13 @@ /* May be overridden with a custom value. Be aware that the effective * macro length is half of this value: each keypress is recorded twice * because of the down-event and up-event. This is not a bug, it's the - * intended behavior. */ -#define DYNAMIC_MACRO_SIZE 256 + * intended behavior. + * + * Usually it should be fine to set the macro size to at least 256 but + * there have been reports of it being too much in some users' cases, + * so 128 is considered a safe default. + */ +#define DYNAMIC_MACRO_SIZE 128 #endif /* DYNAMIC_MACRO_RANGE must be set as the last element of user's diff --git a/readme.md b/readme.md index a7320202b..d28d7c3ff 100644 --- a/readme.md +++ b/readme.md @@ -823,7 +823,7 @@ And then, to assign this macro to a key on your keyboard layout, you just use `M ## Dynamic macros: record and replay macros in runtime -In addition to the static macros described above, you may enable the dynamic macros which you may record while writing. They are forgotten as soon as the keyboard is unplugged. Only two such macros may be stored at the same time, with the total length of 128 keypresses. +In addition to the static macros described above, you may enable the dynamic macros which you may record while writing. They are forgotten as soon as the keyboard is unplugged. Only two such macros may be stored at the same time, with the total length of 64 keypresses (by default). To enable them, first add a new element to the `planck_keycodes` enum -- `DYNAMIC_MACRO_RANGE`: @@ -864,7 +864,7 @@ Add the following code to the very beginning of your `process_record_user()` fun To start recording the macro, press either `DYN_REC_START1` or `DYN_REC_START2`. To finish the recording, press the `_DYN` layer button. The handler awaits specifically for the `MO(_DYN)` keycode as the "stop signal" so please don't use any fancy ways to access this layer, use the regular `MO()` modifier. To replay the macro, press either `DYN_MACRO_PLAY1` or `DYN_MACRO_PLAY2`. -If the LED-s start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by setting the `DYNAMIC_MACRO_SIZE` preprocessor macro (default value: 256; please read the comments for it in the header). +If the LED-s start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by setting the `DYNAMIC_MACRO_SIZE` preprocessor macro (default value: 128; please read the comments for it in the header). For the details about the internals of the dynamic macros, please read the comments in the `dynamic_macro.h` header. -- cgit v1.2.3 From 5b2e455d3b71bfb90754930d1f22d3e8ce98b927 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Mon, 10 Oct 2016 00:46:20 +0700 Subject: Unicode map framework. Allow unicode up to 0xFFFFF using separate mapping table --- build_keyboard.mk | 5 +++++ quantum/keymap.h | 7 +++++++ quantum/process_keycode/process_unicode.c | 26 ++++++++++++++++++++++++++ quantum/process_keycode/process_unicode.h | 4 ++++ quantum/quantum.c | 3 +++ readme.md | 6 ++++++ 6 files changed, 51 insertions(+) (limited to 'readme.md') diff --git a/build_keyboard.mk b/build_keyboard.mk index 03a69b146..282adcb11 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -153,6 +153,11 @@ ifeq ($(strip $(UCIS_ENABLE)), yes) UNICODE_ENABLE = yes endif +ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) + OPT_DEFS += -DUNICODEMAP_ENABLE + UNICODE_ENABLE = yes +endif + ifeq ($(strip $(UNICODE_ENABLE)), yes) OPT_DEFS += -DUNICODE_ENABLE SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c diff --git a/quantum/keymap.h b/quantum/keymap.h index 98ddfd0c5..0daa00120 100644 --- a/quantum/keymap.h +++ b/quantum/keymap.h @@ -84,6 +84,10 @@ enum quantum_keycodes { QK_MOD_TAP_MAX = 0x6FFF, QK_TAP_DANCE = 0x7100, QK_TAP_DANCE_MAX = 0x71FF, +#ifdef UNICODEMAP_ENABLE + QK_UNICODE_MAP = 0x7800, + QK_UNICODE_MAP_MAX = 0x7FFF, +#endif #ifdef UNICODE_ENABLE QK_UNICODE = 0x8000, QK_UNICODE_MAX = 0xFFFF, @@ -335,5 +339,8 @@ enum quantum_keycodes { #define UC(n) UNICODE(n) #endif +#ifdef UNICODEMAP_ENABLE + #define X(n) (n | QK_UNICODE_MAP) +#endif #endif diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index 6a30afe29..37dd471ff 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -78,6 +78,32 @@ bool process_unicode(uint16_t keycode, keyrecord_t *record) { return true; } +#ifdef UNICODEMAP_ENABLE +__attribute__((weak)) +const uint32_t PROGMEM unicode_map[] = { +}; + +// 5 digit max because of linux limitation +void register_hex32(uint32_t hex) { + for(int i = 4; i >= 0; i--) { + uint8_t digit = ((hex >> (i*4)) & 0xF); + register_code(hex_to_keycode(digit)); + unregister_code(hex_to_keycode(digit)); + } +} + +bool process_unicode_map(uint16_t keycode, keyrecord_t *record) { + if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) { + const uint32_t* map = unicode_map; + uint16_t index = keycode & 0x7FF; + unicode_input_start(); + register_hex32(pgm_read_dword_far(&map[index])); + unicode_input_finish(); + } + return true; +} +#endif + #ifdef UCIS_ENABLE qk_ucis_state_t qk_ucis_state; diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h index 27f8072ee..a6c7e4584 100644 --- a/quantum/process_keycode/process_unicode.h +++ b/quantum/process_keycode/process_unicode.h @@ -20,6 +20,10 @@ void register_hex(uint16_t hex); bool process_unicode(uint16_t keycode, keyrecord_t *record); +#ifdef UNICODEMAP_ENABLE +bool process_unicode_map(uint16_t keycode, keyrecord_t *record); +#endif + #ifdef UCIS_ENABLE #ifndef UCIS_MAX_SYMBOL_LENGTH #define UCIS_MAX_SYMBOL_LENGTH 32 diff --git a/quantum/quantum.c b/quantum/quantum.c index a16bd5443..098312e6e 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -128,6 +128,9 @@ bool process_record_quantum(keyrecord_t *record) { #endif #ifdef UCIS_ENABLE process_ucis(keycode, record) && + #endif + #ifdef UNICODEMAP_ENABLE + process_unicode_map(keycode, record) && #endif true)) { return false; diff --git a/readme.md b/readme.md index a7320202b..2653ab2ea 100644 --- a/readme.md +++ b/readme.md @@ -320,6 +320,12 @@ This enables MIDI sending and receiving with your keyboard. To enter MIDI send m This allows you to send unicode symbols via `UC()` in your keymap. Only codes up to 0x7FFF are currently supported. +`UNICODEMAP_ENABLE` + +This allows sending unicode symbols using `X()` in your keymap. Codes +up to 0xFFFFF are supported, including emojis. But you need to maintain a +separate mapping table in your keymap file. + `BLUETOOTH_ENABLE` This allows you to interface with a Bluefruit EZ-key to send keycodes wirelessly. It uses the D2 and D3 pins. -- cgit v1.2.3 From e27a754b70434de88a37c4a572e4ca5f7730ff58 Mon Sep 17 00:00:00 2001 From: Jack & Erez Date: Wed, 12 Oct 2016 22:18:27 -0400 Subject: [Jack & Erez] Simplifies and documents TO --- keyboards/ergodox/keymaps/dave/keymap.c | 12 ++++++------ quantum/keymap.h | 5 ++++- readme.md | 2 ++ 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'readme.md') diff --git a/keyboards/ergodox/keymaps/dave/keymap.c b/keyboards/ergodox/keymaps/dave/keymap.c index 32c70097b..23c4e0490 100644 --- a/keyboards/ergodox/keymaps/dave/keymap.c +++ b/keyboards/ergodox/keymaps/dave/keymap.c @@ -38,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_H, CTL_T(KC_GRV),KC_NUBS,KC_NO, KC_NO, KC_LALT, KC_PSCREEN, KC_PSCREEN, - TO(PROG, ON_PRESS), + TO(PROG), KC_SPC, MO(NAVI), KC_LGUI, // right hand KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_BSPC, @@ -47,7 +47,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_RALT,KC_LBRC,KC_RBRC,KC_NO, CTL_T(KC_QUOT), MT(0x5, KC_NO), MT(0x5, KC_NO), - TO(PROG, ON_PRESS), + TO(PROG), KC_RGUI, MO(PROG), KC_SPC ), @@ -81,7 +81,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - TO(NAVI, ON_PRESS), + TO(NAVI), KC_TRNS, KC_TRNS, KC_TRNS, // right hand KC_TRNS, KC_TRNS, KC_NO, KC_PSLS, KC_PAST, KC_PMNS, KC_EQUAL, @@ -90,7 +90,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PENT, KC_TRNS, KC_P0, KC_P0, KC_PDOT, KC_PENT, KC_TRNS, KC_TRNS, KC_TRNS, - TO(NAVI, ON_PRESS), + TO(NAVI), KC_TRNS, KC_TRNS, KC_TRNS ), @@ -123,7 +123,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_TRNS, - TO(BASE, ON_PRESS), + TO(BASE), KC_TRNS, KC_TRNS, KC_TRNS, // right hand KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, @@ -132,7 +132,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - TO(BASE, ON_PRESS), + TO(BASE), KC_TRNS, KC_TRNS, KC_TRNS ), }; diff --git a/quantum/keymap.h b/quantum/keymap.h index 4b2192cb2..85c090972 100644 --- a/quantum/keymap.h +++ b/quantum/keymap.h @@ -296,7 +296,10 @@ enum quantum_keycodes { // ON_PRESS = 1 // ON_RELEASE = 2 // Unless you have a good reason not to do so, prefer ON_PRESS (1) as your default. -#define TO(layer, when) (layer | QK_TO | (when << 0x4)) +// In fact, we changed it to assume ON_PRESS for sanity/simplicity. If needed, you can add your own +// keycode modeled after the old version, kept below for this. +/* #define TO(layer, when) (layer | QK_TO | (when << 0x4)) */ +#define TO(layer) (layer | QK_TO | (ON_PRESS << 0x4)) // Momentary switch layer - 256 layer max #define MO(layer) (layer | QK_MOMENTARY) diff --git a/readme.md b/readme.md index f20ab41b1..80f0a3ab2 100644 --- a/readme.md +++ b/readme.md @@ -379,6 +379,8 @@ Instead of using `FNx` when defining `ACTION_*` functions, you can use `F(x)` - `TG(layer)` - toggles a layer on or off. As with `MO()`, you should set this key as `KC_TRNS` in the destination layer so that tapping it again actually toggles back to the original layer. Only works upwards in the layer stack. +`TO(layer)` - Goes to a layer. This code is special, because it lets you go either up or down the stack -- just goes directly to the layer you want. So while other codes only let you go _up_ the stack (from layer 0 to layer 3, for example), `TO(2)` is going to get you to layer 2, no matter where you activate it from -- even if you're currently on layer 5. This gets activated on keydown (as soon as the key is pressed). + ### Fun with modifier keys -- cgit v1.2.3