Compare commits

...

21 Commits

Author SHA1 Message Date
328bde1624 Merge pull request #1323 from nikchi/master
Variable tapping terms
2017-05-30 15:38:22 -04:00
3c4022c41b hmm? 2017-05-30 14:19:57 -04:00
2c9f846608 Merge pull request #2 from qmk/master
pull in new qmk changes
2017-05-30 14:17:48 -04:00
cb791cf6cd Merge branch 'master' of https://github.com/qmk/qmk_firmware 2017-05-30 12:49:38 -04:00
9ecfc23292 make qmk bot do the hard work 2017-05-30 12:49:26 -04:00
4549b0417e Merge pull request #1342 from priyadi/adafruit-mouse-buttons
Adafruit Feather BLE / BLE Friend mouse buttons support
2017-05-30 12:10:45 -04:00
3a1a7d6472 Merge branch 'master' of https://github.com/qmk/qmk_firmware 2017-05-30 11:46:34 -04:00
7eccbfe737 exclude PRs 2017-05-30 11:46:25 -04:00
5393bc6f4e switched to uint8 and 16 2017-05-29 21:25:50 -04:00
732a115b32 Merge pull request #1344 from qmk/jackhumbert-patch-1
Re-enable mouse buttons from #1327
2017-05-29 15:17:38 -04:00
b6c60333e4 Re-enable mouse buttons 2017-05-29 13:21:38 -04:00
0c351fa98b no master needed on push maybe 2017-05-29 12:49:25 -04:00
f0fc2db4e2 Adafruit Feather BLE / BLE Friend mouse buttons support 2017-05-29 18:17:21 +07:00
66e9cf9718 clarified tap 2017-05-26 15:59:34 -04:00
1bff72c009 - 2017-05-26 00:19:12 -04:00
d462409762 tenative readme for variable timing tap 2017-05-26 00:18:59 -04:00
b3144112d3 removed need to set customtapping term 0. defaults to 0 already 2017-05-25 16:38:06 -04:00
7c8b166cce changed -1 to 0 can't have negative unsigned ints 🤔 2017-05-25 16:29:57 -04:00
aeb3a34636 moved specific tap term to its own function
included custom_tapping_term in action struct
2017-05-25 16:26:30 -04:00
e695b5a33b Added per case tapping term, updated FF-nikchi keymap. 2017-05-25 00:41:00 -04:00
17a378715e Tapping Term and Memes TD for FF 2017-05-24 23:43:02 -04:00
11 changed files with 98 additions and 37 deletions

View File

@ -11,8 +11,6 @@ env:
- secure: vBTSL34BDPxDilKUuTXqU4CJ26Pv5hogD2nghatkxSQkI1/jbdnLj/DQdPUrMJFDIY6TK3AltsBx72MaMsLQ1JO/Ou24IeHINHXzUC1FlS9yQa48cpxnhX5kzXNyGs3oa0qaFbvnr7RgYRWtmD52n4bIZuSuW+xpBv05x2OCizdT2ZonH33nATaHGFasxROm4qYZ241VfzcUv766V6RVHgL4x9V08warugs+RENVkfzxxwhk3NmkrISabze0gSVJLHBPHxroZC6EUcf/ocobcuDrCwFqtEt90i7pNIAFUE7gZsN2uE75LmpzAWin21G7lLPcPL2k4FJVd8an1HiP2WmscJU6U89fOfMb2viObnKcCzebozBCmKGtHEuXZo9FcReOx49AnQSpmESJGs+q2dL/FApkTjQiyT4J6O5dJpoww0/r57Wx0cmmqjETKBb5rSgXM51Etk3wO09mvcPHsEwrT7qH8r9XWdyCDoEn7FCLX3/LYnf/D4SmZ633YPl5gv3v9XEwxR5+04akjgnvWDSNIaDbWBdxHNb7l4pMc+WR1bwCyMyA7KXj0RrftEGOrm9ZRLe6BkbT4cycA+j77nbPOMcyZChliV9pPQos+4TOJoTzcK2L8yWVoY409aDNVuAjdP6Yum0R2maBGl/etLmIMpJC35C5/lZ+dUNjJAM=
before_install:
- wget http://www.atmel.com/images/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz
- openssl aes-256-cbc -K $encrypted_b0ee987fd0fc_key -iv $encrypted_b0ee987fd0fc_iv -in secrets.tar.enc -out secrets.tar -d
- tar xvf secrets.tar
install:
- tar -zxf avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz
- export PATH="$PATH:$TRAVIS_BUILD_DIR/avr8-gnu-toolchain-linux_x86_64/bin"

View File

@ -3,8 +3,8 @@
#include "../../config.h"
#define TAPPING_TERM 300
#define LEADER_TIMEOUT 400
#define TAPPING_TERM 200
#define LEADER_TIMEOUT 800
#define DISABLE_SPACE_CADET_ROLLOVER
@ -21,4 +21,3 @@
// place overrides here
#endif

View File

@ -6,6 +6,7 @@
#include "quantum.h"
#define _______ KC_TRNS
#define EMOJIBLOCK 5
//declarations for tap dancing emojis
@ -13,6 +14,7 @@ void register_hex32(uint32_t hex);
void cycleEmojis(qk_tap_dance_state_t *state, void *user_data);
void cycleAnimals(qk_tap_dance_state_t *state, void *user_data);
void cycleHands(qk_tap_dance_state_t *state, void *user_data);
void cycleMemes(qk_tap_dance_state_t *state, void *user_data);
void tap(uint16_t keycode){
register_code(keycode);
@ -24,7 +26,8 @@ enum taps{
TD_CTCPS = 0,
EMOJIS,
ANIMAL,
HAND
HAND,
MEMES
};
enum unicode_name { // split every five emojis
@ -62,22 +65,16 @@ enum my_macros {
RIGHTDESK,
CLOSEDESK
};
enum quick {
DISFACE = 0,
TFLIP,
TPUT,
SHRUG,
FACE,
RANDIG
};
// Tap Dance Definitions
qk_tap_dance_action_t tap_dance_actions[] = {
// Tap once for CTRL, twice for Caps Lock
[TD_CTCPS] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_CAPS),
[EMOJIS] = ACTION_TAP_DANCE_FN_ADVANCED(cycleEmojis, NULL, NULL),
[ANIMAL] = ACTION_TAP_DANCE_FN_ADVANCED(cycleAnimals, NULL, NULL),
[HAND] = ACTION_TAP_DANCE_FN_ADVANCED(cycleHands, NULL, NULL)
[EMOJIS] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleEmojis, NULL, NULL, 800),
[ANIMAL] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleAnimals, NULL, NULL, 800),
[HAND] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleHands, NULL, NULL, 800),
[MEMES] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleMemes, NULL, NULL, 800)
// Other declarations would go here, separated by commas, if you have them
};
@ -143,7 +140,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TD(TD_CTCPS),KC_LGUI,KC_LALT, KC_SPC, KC_LEAD,KC_RGUI, KC_APP,MO(1) , KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT),
[1] = KEYMAP(\
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \
TD(EMOJIS),TD(ANIMAL),TD(HAND),X(SMRK),X(WEARY),X(UNAMU), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL,KC_BSPC, KC_MPRV,KC_MPLY,KC_MNXT, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \
TD(EMOJIS),TD(ANIMAL),TD(HAND),TD(MEMES),X(WEARY),X(UNAMU), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL,KC_BSPC, KC_MPRV,KC_MPLY,KC_MNXT, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \
KC_TAB, KC_Q, M(0), KC_E, KC_R,X(EGGPL),X(WATER), KC_U, KC_I, KC_O, KC_P, KC_UP ,KC_RBRC,KC_BSLS, KC_MUTE,KC_VOLD,KC_VOLU, KC_P7, KC_P8, KC_P9,KC_PPLS, \
KC_LCTL, M(1), M(3), M(2), KC_F, X(LIT), X(SNEK), KC_J, KC_K, KC_L,KC_LEFT,KC_RGHT, KC_ENT, KC_P4, KC_P5, KC_P6, \
KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, X(HUNDR), X(BBB), X(POO), KC_M,KC_COMM, KC_DOT,KC_DOWN, KC_RSFT, KC_MS_U, KC_P1, KC_P2, KC_P3,KC_PENT, \
@ -170,6 +167,11 @@ void matrix_scan_user(void) {
tap(KC_C);
unregister_code(KC_LCTL);
}
SEQ_THREE_KEYS(KC_L,KC_I,KC_T) { // 🔥🔥
unicode_input_start();
register_hex32(pgm_read_dword(&unicode_map[LIT]));
unicode_input_finish();
}
}
}
@ -186,7 +188,7 @@ void cycleEmojis(qk_tap_dance_state_t *state, void *user_data) {
register_hex32(pgm_read_dword(&unicode_map[state->count]));
unicode_input_finish();
}
else if(state->count <= 5) {
else if(state->count <= EMOJIBLOCK) {
tap(KC_BSPC);
unicode_input_start();
register_hex32(pgm_read_dword(&unicode_map[state->count]));
@ -200,7 +202,7 @@ void cycleAnimals(qk_tap_dance_state_t *state, void *user_data) {
register_hex32(pgm_read_dword(&unicode_map[state->count+5]));
unicode_input_finish();
}
else if(state->count <= 5) {
else if(state->count <= EMOJIBLOCK) {
tap(KC_BSPC);
unicode_input_start();
register_hex32(pgm_read_dword(&unicode_map[state->count+5]));
@ -214,7 +216,7 @@ void cycleHands(qk_tap_dance_state_t *state, void *user_data) {
register_hex32(pgm_read_dword(&unicode_map[state->count+10]));
unicode_input_finish();
}
else if(state->count <= 5) {
else if(state->count <= EMOJIBLOCK) {
tap(KC_BSPC);
unicode_input_start();
register_hex32(pgm_read_dword(&unicode_map[state->count+10]));
@ -222,3 +224,18 @@ void cycleHands(qk_tap_dance_state_t *state, void *user_data) {
}
};
void cycleMemes(qk_tap_dance_state_t *state, void *user_data) {
if(state->count == 1) {
unicode_input_start();
register_hex32(pgm_read_dword(&unicode_map[state->count+15]));
unicode_input_finish();
}
else if(state->count <= EMOJIBLOCK) {
tap(KC_BSPC);
unicode_input_start();
register_hex32(pgm_read_dword(&unicode_map[state->count+15]));
unicode_input_finish();
}
};

View File

@ -0,0 +1,9 @@
# Tap Dancing to different beats.
Tap Dance is constrained normally by `TAPPING_TERM` defined in your keyboard's config.h This proves to be challenging to work with when sometimes you just need more time to tap out your dance, or even a different "beat".
- `ACTION_TAP_DANCE_FN_ADVANCED_TIME(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, tap_specific_tapping_term)` : This works the same as `ACTION_TAP_DANCE_FN_ADVANCED` just with the extra `tap_specific_tapping_term` arguement at the end. This way you can set a specific tap dance to have a longer or shorter tap in between your taps, giving you more, or less, time in between each tap.
`tap_specific_tapping_term` should be the same type and range of values that one would put into the `TAPPING_TERM` definition in the config.h file.

View File

@ -127,14 +127,22 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) {
return true;
}
void matrix_scan_tap_dance () {
if (highest_td == -1)
return;
uint16_t tap_user_defined;
for (int i = 0; i <= highest_td; i++) {
for (uint8_t i = 0; i <= highest_td; i++) {
qk_tap_dance_action_t *action = &tap_dance_actions[i];
if (action->state.count && timer_elapsed (action->state.timer) > TAPPING_TERM) {
if(action->custom_tapping_term > 0 ) {
tap_user_defined = action->custom_tapping_term;
}
else{
tap_user_defined = TAPPING_TERM;
}
if (action->state.count && timer_elapsed (action->state.timer) > tap_user_defined) {
process_tap_dance_action_on_dance_finished (action);
reset_tap_dance (&action->state);
}

View File

@ -44,6 +44,7 @@ typedef struct
qk_tap_dance_user_fn_t on_reset;
} fn;
qk_tap_dance_state_t state;
uint16_t custom_tapping_term;
void *user_data;
} qk_tap_dance_action_t;
@ -68,6 +69,12 @@ typedef struct
.user_data = NULL, \
}
#define ACTION_TAP_DANCE_FN_ADVANCED_TIME(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, tap_specific_tapping_term) { \
.fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset }, \
.user_data = NULL, \
.custom_tapping_term = tap_specific_tapping_term, \
}
extern qk_tap_dance_action_t tap_dance_actions[];
/* To be used internally */

View File

@ -324,9 +324,10 @@ void process_action(keyrecord_t *record, action_t action)
tp_buttons |= (1<<2);
break;
default:
mousekey_on(action.key.code);
mousekey_send();
break;
}
mousekey_on(action.key.code);
mousekey_send();
} else {
switch (action.key.code) {
case KC_MS_BTN1:
@ -339,9 +340,10 @@ void process_action(keyrecord_t *record, action_t action)
tp_buttons &= ~(1<<2);
break;
default:
mousekey_off(action.key.code);
mousekey_send();
break;
}
mousekey_off(action.key.code);
mousekey_send();
}
break;
#endif

View File

@ -87,6 +87,7 @@ struct queue_item {
uint16_t consumer;
struct __attribute__((packed)) {
int8_t x, y, scroll, pan;
uint8_t buttons;
} mousemove;
};
};
@ -699,6 +700,22 @@ static bool process_queue_item(struct queue_item *item, uint16_t timeout) {
strcpy_P(fmtbuf, PSTR("AT+BLEHIDMOUSEMOVE=%d,%d,%d,%d"));
snprintf(cmdbuf, sizeof(cmdbuf), fmtbuf, item->mousemove.x,
item->mousemove.y, item->mousemove.scroll, item->mousemove.pan);
if (!at_command(cmdbuf, NULL, 0, true, timeout)) {
return false;
}
strcpy_P(cmdbuf, PSTR("AT+BLEHIDMOUSEBUTTON="));
if (item->mousemove.buttons & MOUSE_BTN1) {
strcat(cmdbuf, "L");
}
if (item->mousemove.buttons & MOUSE_BTN2) {
strcat(cmdbuf, "R");
}
if (item->mousemove.buttons & MOUSE_BTN3) {
strcat(cmdbuf, "M");
}
if (item->mousemove.buttons == 0) {
strcat(cmdbuf, "0");
}
return at_command(cmdbuf, NULL, 0, true, timeout);
#endif
default:
@ -757,7 +774,7 @@ bool adafruit_ble_send_consumer_key(uint16_t keycode, int hold_duration) {
#ifdef MOUSE_ENABLE
bool adafruit_ble_send_mouse_move(int8_t x, int8_t y, int8_t scroll,
int8_t pan) {
int8_t pan, uint8_t buttons) {
struct queue_item item;
item.queue_type = QTMouseMove;
@ -765,6 +782,7 @@ bool adafruit_ble_send_mouse_move(int8_t x, int8_t y, int8_t scroll,
item.mousemove.y = y;
item.mousemove.scroll = scroll;
item.mousemove.pan = pan;
item.mousemove.buttons = buttons;
while (!send_buf.enqueue(item)) {
send_buf_send_one();

View File

@ -43,7 +43,7 @@ extern bool adafruit_ble_send_consumer_key(uint16_t keycode, int hold_duration);
* The parameters are signed and indicate positive of negative direction
* change. */
extern bool adafruit_ble_send_mouse_move(int8_t x, int8_t y, int8_t scroll,
int8_t pan);
int8_t pan, uint8_t buttons);
#endif
/* Compute battery voltage by reading an analog pin.

View File

@ -669,7 +669,7 @@ static void send_mouse(report_mouse_t *report)
if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) {
#ifdef MODULE_ADAFRUIT_BLE
// FIXME: mouse buttons
adafruit_ble_send_mouse_move(report->x, report->y, report->v, report->h);
adafruit_ble_send_mouse_move(report->x, report->y, report->v, report->h, report->buttons);
#else
bluefruit_serial_send(0xFD);
bluefruit_serial_send(0x00);

View File

@ -4,16 +4,18 @@ set -o errexit -o nounset
rev=$(git rev-parse --short HEAD)
git config --global user.name "Travis CI"
git config --global user.email "jack.humb+travis.ci@gmail.com"
if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then
git config --global user.name "QMK Bot"
git config --global user.email "hello@qmk.fm"
openssl aes-256-cbc -K $encrypted_b0ee987fd0fc_key -iv $encrypted_b0ee987fd0fc_iv -in secrets.tar.enc -out secrets.tar -d
tar xvf secrets.tar
chmod 600 id_rsa_qmk_firmware
chmod 600 qmk.fm
eval `ssh-agent -s`
ssh-add id_rsa_qmk_firmware
ssh-add qmk.fm
if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then
increment_version ()
{
@ -42,6 +44,7 @@ if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then
cd ..
git clone git@github.com:qmk/qmk.fm.git
cd qmk.fm
ssh-add ../qmk_firmware/qmk.fm
#git submodule update --init --recursive
#rm -rf keyboard
#rm -rf keyboards
@ -55,7 +58,7 @@ if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then
git add -A
git commit -m "generated from qmk/qmk_firmware@${rev}"
git push git@github.com:qmk/qmk.fm.git master
git push git@github.com:qmk/qmk.fm.git
fi