Keymap: Refactor edvorakjp user library (#4480)
* Refactor edvorakjp user library * add tap dance support * update keymaps * edvorakjp: add SWAP_SCLN option * fix behavior of SWAP_SCLN
This commit is contained in:
		
							parent
							
								
									0031e46191
								
							
						
					
					
						commit
						f3ffd6ad50
					
				
					 14 changed files with 406 additions and 255 deletions
				
			
		| 
						 | 
				
			
			@ -4,6 +4,7 @@
 | 
			
		|||
#undef TAPPING_FORCE_HOLD
 | 
			
		||||
#undef TAPPING_TERM
 | 
			
		||||
#define TAPPING_TERM 120
 | 
			
		||||
#define SWAP_SCLN
 | 
			
		||||
 | 
			
		||||
// If you need more program area, try select and reduce rgblight modes to use.
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,7 +11,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
 | 
			
		|||
  switch(keycode) {
 | 
			
		||||
    case KC_LOCK:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
        if (edvorakjp_config.enable_kc_lang) {
 | 
			
		||||
        if (get_enable_kc_lang()) {
 | 
			
		||||
          SEND_STRING( SS_LCTRL(SS_LSFT(SS_TAP(X_POWER))) );
 | 
			
		||||
        } else {
 | 
			
		||||
          SEND_STRING( SS_LGUI("l") );
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,7 +5,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 | 
			
		|||
 | 
			
		||||
  [_EDVORAK] = LAYOUT_kc(
 | 
			
		||||
  //,----+----+----+----+----+----.              ,----+----+----+----+----+----.
 | 
			
		||||
     LBRC,RBRC,COMM,DOT , P  , Y  ,                F  , G  , R  , W  , Q  ,BSLS,
 | 
			
		||||
     LBRC,RBRC,COMM,DOT , Y  , P  ,                F  , G  , R  , W  , Q  ,BSLS,
 | 
			
		||||
  //|----+----+----+----+----+----|              |----+----+----+----+----+----|
 | 
			
		||||
     EQL , A  , O  , E  , I  , U  ,                D  , T  , N  , S  , M  ,MINS,
 | 
			
		||||
  //|----+----+----+----+----+----|              |----+----+----+----+----+----|
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 | 
			
		|||
  //,----+----+----+----+----+----.              ,----+----+----+----+----+----.
 | 
			
		||||
     GRV ,EXLM, AT ,HASH,DLR ,PERC,               CIRC,AMPR,ASTR,LPRN,RPRN,BSPC,
 | 
			
		||||
  //|----+----+----+----+----+----|              |----+----+----+----+----+----|
 | 
			
		||||
     LBRC,RBRC,COMM,DOT , P  , Y  ,                F  , G  , R  , W  , Q  ,BSLS,
 | 
			
		||||
     LBRC,RBRC,COMM,DOT , Y  , P  ,                F  , G  , R  , W  , Q  ,BSLS,
 | 
			
		||||
  //|----+----+----+----+----+----|              |----+----+----+----+----+----|
 | 
			
		||||
     EQL , A  , O  , E  , I  , U  ,                D  , T  , N  , S  , M  ,MINS,
 | 
			
		||||
  //|----+----+----+----+----+----+----.    ,----|----+----+----+----+----+----|
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,15 +23,10 @@ void render_status(struct CharacterMatrix *matrix) {
 | 
			
		|||
 | 
			
		||||
  // Render to mode icon
 | 
			
		||||
  static char logo[][2][3] = {{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}};
 | 
			
		||||
  if (edvorakjp_config.enable_kc_lang) {
 | 
			
		||||
    matrix_write(matrix, logo[0][0]);
 | 
			
		||||
    matrix_write_P(matrix, PSTR("\n"));
 | 
			
		||||
    matrix_write(matrix, logo[0][1]);
 | 
			
		||||
  } else {
 | 
			
		||||
    matrix_write(matrix, logo[1][0]);
 | 
			
		||||
    matrix_write_P(matrix, PSTR("\n"));
 | 
			
		||||
    matrix_write(matrix, logo[1][1]);
 | 
			
		||||
  }
 | 
			
		||||
  int mode_number = get_enable_kc_lang() ? 0 : 1;
 | 
			
		||||
  matrix_write(matrix, logo[mode_number][0]);
 | 
			
		||||
  matrix_write(matrix, "\n");
 | 
			
		||||
  matrix_write(matrix, logo[mode_number][1]);
 | 
			
		||||
 | 
			
		||||
  // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below
 | 
			
		||||
  char buf[40];
 | 
			
		||||
| 
						 | 
				
			
			@ -63,7 +58,7 @@ void render_status(struct CharacterMatrix *matrix) {
 | 
			
		|||
  // Host Keyboard LED Status
 | 
			
		||||
  char led[40];
 | 
			
		||||
  snprintf(led, sizeof(led), "\n%s %s %s %s",
 | 
			
		||||
      edvorakjp_config.enable_jp_extra_layer && japanese_mode ? "EXT" : "   ",
 | 
			
		||||
      get_enable_jp_extra_layer() && get_japanese_mode() ? "EXT" : "   ",
 | 
			
		||||
      (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? "NMLK" : "    ",
 | 
			
		||||
      (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? "CAPS" : "    ",
 | 
			
		||||
      (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ? "SCLK" : "    ");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue