mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-12-14 22:00:53 +00:00
Compare commits
No commits in common. "e9206d2b16153ed1c58ab148b2f1472708e55930" and "3ee7403e2642ba2f573deaa5d374d557dc11942a" have entirely different histories.
e9206d2b16
...
3ee7403e26
@ -21,6 +21,11 @@ A layout based on neo2
|
||||
#endif
|
||||
#define LEADER_TIMEOUT 300
|
||||
|
||||
#define TAP_ONCE(code) \
|
||||
register_code (code); \
|
||||
unregister_code (code)
|
||||
|
||||
|
||||
// Automatic number generation of important keywords
|
||||
enum my_keycodes{
|
||||
// Layer numbers follow the neo2 terminology, i.e. base layer = layer 1
|
||||
@ -252,11 +257,22 @@ L06 -> <TBD>: UNSPECIFIED
|
||||
|
||||
void leader_end_user(void) {
|
||||
if (leader_sequence_one_key(KC_1)) {
|
||||
send_unicode_string("¯\\_(ツ)_/¯");
|
||||
// ¯\_(ツ)_/¯
|
||||
unicode_input_start(); register_hex(0xaf); unicode_input_finish();
|
||||
register_code (KC_RALT); TAP_ONCE (KC_MINS); unregister_code (KC_RALT);
|
||||
register_code (KC_RSFT); TAP_ONCE (KC_8); unregister_code (KC_RSFT);
|
||||
unicode_input_start (); register_hex(0x30c4); unicode_input_finish();
|
||||
register_code (KC_RSFT); TAP_ONCE (KC_9); TAP_ONCE(KC_7); unregister_code (KC_RSFT);
|
||||
unicode_input_start (); register_hex(0xaf); unicode_input_finish();
|
||||
}
|
||||
|
||||
if (leader_sequence_one_key(KC_2)) {
|
||||
send_unicode_string("凸(ツ)凸");
|
||||
// 凸(ツ)凸
|
||||
unicode_input_start(); register_hex(0x51F8); unicode_input_finish();
|
||||
register_code (KC_RSFT); TAP_ONCE (KC_8); unregister_code (KC_RSFT);
|
||||
unicode_input_start (); register_hex(0x30c4); unicode_input_finish();
|
||||
register_code (KC_RSFT); TAP_ONCE (KC_9); unregister_code (KC_RSFT);
|
||||
unicode_input_start (); register_hex(0x51F8); unicode_input_finish();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1328,25 +1328,33 @@ void send_degree_symbol(tap_dance_state_t* state, void* user_data) {
|
||||
switch (state->count) {
|
||||
case 4:
|
||||
// ℃
|
||||
register_unicode(0x2103);
|
||||
unicode_input_start();
|
||||
register_hex(0x2103);
|
||||
unicode_input_finish();
|
||||
print("You pressed the Degrees key 4 times!\n");
|
||||
reset_tap_dance(state);
|
||||
break;
|
||||
case 3:
|
||||
//℉
|
||||
register_unicode(0x2109);
|
||||
unicode_input_start();
|
||||
register_hex(0x2109);
|
||||
unicode_input_finish();
|
||||
print("You pressed the Degrees key 3 times!\n");
|
||||
reset_tap_dance(state);
|
||||
break;
|
||||
case 2:
|
||||
// €
|
||||
register_unicode(0x20AC);
|
||||
unicode_input_start();
|
||||
register_hex(0x20AC);
|
||||
unicode_input_finish();
|
||||
print("You pressed the Degrees key 2 times!\n");
|
||||
reset_tap_dance(state);
|
||||
break;
|
||||
case 1:
|
||||
// °
|
||||
register_unicode(0x00B0);
|
||||
unicode_input_start();
|
||||
register_hex(0x00B0);
|
||||
unicode_input_finish();
|
||||
print("You pressed the Degrees key 1 time!\n");
|
||||
reset_tap_dance(state);
|
||||
break;
|
||||
|
@ -291,9 +291,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case TUR_A:
|
||||
if (record->event.pressed) {
|
||||
if ( is_capital ) {
|
||||
register_unicode(0x00c2);
|
||||
unicode_input_start();
|
||||
register_hex(0x00c2);
|
||||
unicode_input_finish();
|
||||
} else {
|
||||
register_unicode(0x00e2);
|
||||
unicode_input_start();
|
||||
register_hex(0x00e2);
|
||||
unicode_input_finish();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -301,9 +305,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case TUR_O:
|
||||
if (record->event.pressed) {
|
||||
if ( is_capital ) {
|
||||
register_unicode(0x00d6);
|
||||
unicode_input_start();
|
||||
register_hex(0x00d6);
|
||||
unicode_input_finish();
|
||||
} else {
|
||||
register_unicode(0x00f6);
|
||||
unicode_input_start();
|
||||
register_hex(0x00f6);
|
||||
unicode_input_finish();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -311,9 +319,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case TUR_U:
|
||||
if (record->event.pressed) {
|
||||
if ( is_capital ) {
|
||||
register_unicode(0x00dc);
|
||||
unicode_input_start();
|
||||
register_hex(0x00dc);
|
||||
unicode_input_finish();
|
||||
} else {
|
||||
register_unicode(0x00fc);
|
||||
unicode_input_start();
|
||||
register_hex(0x00fc);
|
||||
unicode_input_finish();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -321,9 +333,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case TUR_I:
|
||||
if (record->event.pressed) {
|
||||
if ( is_capital ) {
|
||||
register_unicode(0x0130);
|
||||
unicode_input_start();
|
||||
register_hex(0x0130);
|
||||
unicode_input_finish();
|
||||
} else {
|
||||
register_unicode(0x0131);
|
||||
unicode_input_start();
|
||||
register_hex(0x0131);
|
||||
unicode_input_finish();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -331,9 +347,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case TUR_G:
|
||||
if (record->event.pressed) {
|
||||
if ( is_capital ) {
|
||||
register_unicode(0x011e);
|
||||
unicode_input_start();
|
||||
register_hex(0x011e);
|
||||
unicode_input_finish();
|
||||
} else {
|
||||
register_unicode(0x011f);
|
||||
unicode_input_start();
|
||||
register_hex(0x011f);
|
||||
unicode_input_finish();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -341,9 +361,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case TUR_C:
|
||||
if (record->event.pressed) {
|
||||
if ( is_capital ) {
|
||||
register_unicode(0x00c7);
|
||||
unicode_input_start();
|
||||
register_hex(0x00c7);
|
||||
unicode_input_finish();
|
||||
} else {
|
||||
register_unicode(0x00e7);
|
||||
unicode_input_start();
|
||||
register_hex(0x00e7);
|
||||
unicode_input_finish();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -351,9 +375,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case TUR_S:
|
||||
if (record->event.pressed) {
|
||||
if ( is_capital ) {
|
||||
register_unicode(0x015e);
|
||||
unicode_input_start();
|
||||
register_hex(0x015e);
|
||||
unicode_input_finish();
|
||||
} else {
|
||||
register_unicode(0x015f);
|
||||
unicode_input_start();
|
||||
register_hex(0x015f);
|
||||
unicode_input_finish();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@ -125,14 +125,12 @@ bool u_xp(bool is_shifted, const char *shifted, const char *plain) {
|
||||
};
|
||||
|
||||
void zalgo(void) {
|
||||
unicode_input_start();
|
||||
int number = (rand() % (8 + 1 - 2)) + 2;
|
||||
unsigned int index;
|
||||
for (index=0; index<number; index++) {
|
||||
uint16_t hex = (rand() % (0x036F + 1 - 0x0300)) + 0x0300;
|
||||
register_hex(hex);
|
||||
}
|
||||
unicode_input_finish();
|
||||
}
|
||||
|
||||
bool combined_text(uint16_t keycode) {
|
||||
@ -140,16 +138,16 @@ bool combined_text(uint16_t keycode) {
|
||||
return false;
|
||||
}
|
||||
tap_code(keycode);
|
||||
|
||||
unicode_input_start();
|
||||
switch (combined_mode) {
|
||||
case CM_CIRCLE:
|
||||
register_unicode(0x20DD);
|
||||
register_hex(0x20DD);
|
||||
break;
|
||||
case CM_NO:
|
||||
register_unicode(0x20E0);
|
||||
register_hex(0x20E0);
|
||||
break;
|
||||
case CM_KEYCAP:
|
||||
register_unicode(0x20E3);
|
||||
register_hex(0x20E3);
|
||||
break;
|
||||
case CM_ZALGO:
|
||||
zalgo();
|
||||
@ -157,6 +155,7 @@ bool combined_text(uint16_t keycode) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
unicode_input_finish();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -73,13 +73,19 @@ static uint32_t math_glyph_exceptions(const uint16_t keycode, const bool shifted
|
||||
}
|
||||
|
||||
bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, uint32_t baseAlphaLower, uint32_t baseAlphaUpper, uint32_t zeroGlyph, uint32_t baseNumberOne, uint32_t spaceGlyph, uint32_t (*exceptions)(const uint16_t keycode, const bool shifted), uint8_t temp_mod, uint8_t temp_osm) {
|
||||
void _register(uint32_t codepoint) {
|
||||
unicode_input_start();
|
||||
register_hex32(codepoint);
|
||||
unicode_input_finish();
|
||||
}
|
||||
|
||||
if ((((temp_mod | temp_osm) & (MOD_MASK_CTRL | MOD_MASK_ALT | MOD_MASK_GUI))) == 0) {
|
||||
bool shifted = ((temp_mod | temp_osm) & MOD_MASK_SHIFT);
|
||||
if (exceptions) {
|
||||
uint32_t res = exceptions(keycode, shifted);
|
||||
if (res) {
|
||||
if (record->event.pressed) {
|
||||
register_unicode(res);
|
||||
_register(res);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -94,7 +100,7 @@ bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, uin
|
||||
|
||||
bool caps = host_keyboard_led_state().caps_lock;
|
||||
uint32_t base = ((shifted == caps) ? baseAlphaLower : baseAlphaUpper);
|
||||
register_unicode(base + (keycode - KC_A));
|
||||
_register(base + (keycode - KC_A));
|
||||
set_mods(temp_mod);
|
||||
}
|
||||
return false;
|
||||
@ -103,7 +109,7 @@ bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, uin
|
||||
return true;
|
||||
}
|
||||
if (record->event.pressed) {
|
||||
register_unicode(zeroGlyph);
|
||||
_register(zeroGlyph);
|
||||
}
|
||||
return false;
|
||||
case KC_1 ... KC_9:
|
||||
@ -111,12 +117,12 @@ bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, uin
|
||||
return true;
|
||||
}
|
||||
if (record->event.pressed) {
|
||||
register_unicode(baseNumberOne + (keycode - KC_1));
|
||||
_register(baseNumberOne + (keycode - KC_1));
|
||||
}
|
||||
return false;
|
||||
case KC_SPACE:
|
||||
if (record->event.pressed) {
|
||||
register_unicode(spaceGlyph); // em space
|
||||
_register(spaceGlyph); // em space
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user