Merge branch 'master' into chibios

This commit is contained in:
flabbergast 2016-01-15 17:11:46 +00:00
commit ffbaeb7986
22 changed files with 413 additions and 257 deletions

View file

@ -34,6 +34,8 @@ void action_macro_play(const macro_t *macro_p)
macro_t macro = END;
uint8_t interval = 0;
uint8_t mod_storage = 0;
if (!macro_p) return;
while (true) {
switch (MACRO_READ()) {
@ -66,6 +68,17 @@ void action_macro_play(const macro_t *macro_p)
interval = MACRO_READ();
dprintf("INTERVAL(%u)\n", interval);
break;
case MOD_STORE:
mod_storage = get_mods();
break;
case MOD_RESTORE:
set_mods(mod_storage);
send_keyboard_report();
break;
case MOD_CLEAR:
clear_mods();
send_keyboard_report();
break;
case 0x04 ... 0x73:
dprintf("DOWN(%02X)\n", macro);
register_code(macro);

View file

@ -64,6 +64,9 @@ enum macro_command_id{
/* 0x74 - 0x83 */
WAIT = 0x74,
INTERVAL,
MOD_STORE,
MOD_RESTORE,
MOD_CLEAR,
/* 0x84 - 0xf3 (reserved for keycode up) */
@ -82,6 +85,9 @@ enum macro_command_id{
#define TYPE(key) DOWN(key), UP(key)
#define WAIT(ms) WAIT, (ms)
#define INTERVAL(ms) INTERVAL, (ms)
#define STORE() MOD_STORE
#define RESTORE() MOD_RESTORE
#define CLEAR() MOD_CLEAR
/* key down */
#define D(key) DOWN(KC_##key)
@ -93,6 +99,12 @@ enum macro_command_id{
#define W(ms) WAIT(ms)
/* interval */
#define I(ms) INTERVAL(ms)
/* store modifier(s) */
#define SM() STORE()
/* restore modifier(s) */
#define RM() RESTORE()
/* clear modifier(s) */
#define CM() CLEAR()
/* for backward comaptibility */
#define MD(key) DOWN(KC_##key)

View file

@ -95,6 +95,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define KC_JPY KC_INT3
#define KC_HENK KC_INT4
#define KC_MHEN KC_INT5
/* Korean specific */
#define KC_HAEN KC_LANG1
#define KC_HANJ KC_LANG2
/* Keypad */
#define KC_P1 KC_KP_1
#define KC_P2 KC_KP_2
@ -114,6 +117,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define KC_PPLS KC_KP_PLUS
#define KC_PEQL KC_KP_EQUAL
#define KC_PENT KC_KP_ENTER
/* Unix function key */
#define KC_EXEC KC_EXECUTE
#define KC_SLCT KC_SELECT
#define KC_AGIN KC_AGAIN
#define KC_PSTE KC_PASTE
/* Mousekey */
#define KC_MS_U KC_MS_UP
#define KC_MS_D KC_MS_DOWN

View file

@ -133,7 +133,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
/* translates keycode to action */
static action_t keycode_to_action(uint8_t keycode)
{
action_t action;
action_t action = {};
switch (keycode) {
case KC_A ... KC_EXSEL:
case KC_LCTRL ... KC_RGUI: