mirror of
				https://github.com/qmk/qmk_userspace.git
				synced 2025-11-03 18:30:07 -05:00 
			
		
		
		
	ça marche !
This commit is contained in:
		
					parent
					
						
							
								11022b0023
							
						
					
				
			
			
				commit
				
					
						23da95ecb5
					
				
			
		
					 8 changed files with 25 additions and 58 deletions
				
			
		| 
						 | 
				
			
			@ -178,7 +178,7 @@ void get_clever_keycode(uint16_t* next_keycode, keyrecord_t* record) {
 | 
			
		|||
        
 | 
			
		||||
        default:
 | 
			
		||||
          // "à"
 | 
			
		||||
          process_key(MOD_ODK, record);
 | 
			
		||||
          process_key(PG_ODK, record);
 | 
			
		||||
          return replace_ongoing_key(PG_A, next_keycode, record);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,7 +42,7 @@ uint16_t get_ongoing_keycode(uint16_t keycode, keyrecord_t* record) {
 | 
			
		|||
 | 
			
		||||
  //if (mods & ~(MOD_MASK_SHIFT | MOD_BIT(KC_ALGR))) {
 | 
			
		||||
  if (mods & ~MOD_MASK_SHIFT) {
 | 
			
		||||
    clear_recent_keys();  // Avoid interfering with ctrl, left alt, alt-gr and gui.
 | 
			
		||||
    clear_recent_keys();  // Avoid interfering with ctrl, alt, alt-gr and gui.
 | 
			
		||||
    return KC_NO;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,7 +21,7 @@ bool process_odk_layer(uint16_t keycode, keyrecord_t *record) {
 | 
			
		|||
    if (record->event.pressed) {    // On press
 | 
			
		||||
 | 
			
		||||
        const uint8_t mods = get_mods() | get_weak_mods() | get_oneshot_mods();
 | 
			
		||||
        //bool mod_odk = false;
 | 
			
		||||
        bool invoke_odk = false;
 | 
			
		||||
        //const uint8_t mods = get_mods() | get_oneshot_mods();
 | 
			
		||||
 | 
			
		||||
        if (keycode == OS_ODK) {
 | 
			
		||||
| 
						 | 
				
			
			@ -33,8 +33,7 @@ bool process_odk_layer(uint16_t keycode, keyrecord_t *record) {
 | 
			
		|||
            return true;
 | 
			
		||||
 | 
			
		||||
        } else if (keycode == PG_ODK) {
 | 
			
		||||
            //mod_odk = true;
 | 
			
		||||
            return true;
 | 
			
		||||
            invoke_odk = true;
 | 
			
		||||
 | 
			
		||||
        } else if (IS_LAYER_ON(_ODK)) {
 | 
			
		||||
            switch (keycode) {
 | 
			
		||||
| 
						 | 
				
			
			@ -50,19 +49,14 @@ bool process_odk_layer(uint16_t keycode, keyrecord_t *record) {
 | 
			
		|||
                    return true;
 | 
			
		||||
        
 | 
			
		||||
                default:
 | 
			
		||||
                    mod_odk();
 | 
			
		||||
                    //mod_odk = true;
 | 
			
		||||
                    //process_odk_layer(MOD_ODK, record);
 | 
			
		||||
                    // Don't use tap_code, it doesn't go through process_record.
 | 
			
		||||
                    // therefore it doesn't trigger the special behaviour of PG_ODK described above
 | 
			
		||||
                    //invoke_key(PG_ODK, record);
 | 
			
		||||
                    invoke_odk = true;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
/*         if (mod_odk) {
 | 
			
		||||
        if (invoke_odk) {
 | 
			
		||||
            // Special behaviour of PG_ODK when shifted
 | 
			
		||||
            // Shift must apply to the next keycode
 | 
			
		||||
            mod_odk = false;
 | 
			
		||||
            //invoke_odk = false;
 | 
			
		||||
            bool is_shifted = false;
 | 
			
		||||
 | 
			
		||||
            if (mods & MOD_MASK_SHIFT) {
 | 
			
		||||
| 
						 | 
				
			
			@ -76,31 +70,10 @@ bool process_odk_layer(uint16_t keycode, keyrecord_t *record) {
 | 
			
		|||
 | 
			
		||||
            if (is_shifted) {
 | 
			
		||||
                set_oneshot_mods(MOD_BIT(KC_LSFT));     // Don't use weak mods !
 | 
			
		||||
                is_shifted = false;
 | 
			
		||||
                //is_shifted = false;
 | 
			
		||||
            }
 | 
			
		||||
            if (keycode == MOD_ODK) { return false; }
 | 
			
		||||
        } */
 | 
			
		||||
            if (keycode == PG_ODK) { return false; }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void mod_odk(void) {
 | 
			
		||||
    // Special behaviour of PG_ODK when shifted
 | 
			
		||||
    // Shift must apply to the next keycode
 | 
			
		||||
    bool is_shifted = false;
 | 
			
		||||
    const uint8_t mods = get_mods() | get_weak_mods() | get_oneshot_mods();
 | 
			
		||||
 | 
			
		||||
    if (mods & MOD_MASK_SHIFT) {
 | 
			
		||||
        del_weak_mods(MOD_MASK_SHIFT);
 | 
			
		||||
        del_oneshot_mods(MOD_MASK_SHIFT);
 | 
			
		||||
        unregister_mods(MOD_MASK_SHIFT);
 | 
			
		||||
        is_shifted = true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    tap_code(PG_ODK);
 | 
			
		||||
 | 
			
		||||
    if (is_shifted) {
 | 
			
		||||
        set_oneshot_mods(MOD_BIT(KC_LSFT));     // Don't use weak mods !
 | 
			
		||||
        is_shifted = false;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -25,7 +25,6 @@ extern "C" {
 | 
			
		|||
#endif
 | 
			
		||||
 | 
			
		||||
bool process_odk_layer(uint16_t keycode, keyrecord_t *record);
 | 
			
		||||
void mod_odk(void);
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -99,12 +99,12 @@ bool process_mods(uint16_t keycode, keyrecord_t *record) {
 | 
			
		|||
  if (IS_OS4A_KEY(keycode)) { return process_os4a_keys(keycode, record); }
 | 
			
		||||
 | 
			
		||||
  // Behaviour of the OS4A layers
 | 
			
		||||
  if (os4a_layer != 0) { exit_os4a_layer = process_os4a_layers(keycode, record); }
 | 
			
		||||
  if (record->event.pressed) {
 | 
			
		||||
    if (os4a_layer != 0) { exit_os4a_layer = process_os4a_layers(keycode, record); }
 | 
			
		||||
 | 
			
		||||
  // When Ctrl or Shift are released, for mouse use.
 | 
			
		||||
  //if (mods_for_mouse(keycode)) { mouse_mods_key_up(keycode, record); }
 | 
			
		||||
 | 
			
		||||
  if (!record->event.pressed) {
 | 
			
		||||
  } else {
 | 
			
		||||
    // When Ctrl or Shift are released, for mouse use.
 | 
			
		||||
    //if (mods_for_mouse(keycode)) { mouse_mods_key_up(keycode, record); }
 | 
			
		||||
    if (os4a_layer != 0 && exit_os4a_layer) { os4a_layer_off(os4a_layer); }
 | 
			
		||||
  }
 | 
			
		||||
  return true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -205,7 +205,6 @@ uint8_t get_os4a_layer(uint16_t keycode) {
 | 
			
		|||
bool os4a_layer_changer(uint16_t keycode) {
 | 
			
		||||
  switch (keycode) {
 | 
			
		||||
    case OS_FA:
 | 
			
		||||
    //case OS_WMNT:
 | 
			
		||||
    case NUMWORD:
 | 
			
		||||
    case TG_FA:
 | 
			
		||||
    case OS_RSA:
 | 
			
		||||
| 
						 | 
				
			
			@ -246,17 +245,20 @@ bool is_oneshot_cancel_key(uint16_t keycode) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
bool is_oneshot_ignored_key(uint16_t keycode) {
 | 
			
		||||
  // On veut que la touche typo soit ignorée par tous les Callum mods sauf Alt-gr.
 | 
			
		||||
  // Ça permet de transmettre les mods à la touche suivante, par ex pour faire Ctrl + K. 
 | 
			
		||||
  // Alt-gr et shift s'appliquent à la touche typo, pour permettre de faire les majuscules plus facilement ainsi que ] avec.
 | 
			
		||||
  uint8_t mods = get_mods() | get_weak_mods() | get_oneshot_mods();
 | 
			
		||||
 | 
			
		||||
  const uint8_t mods = get_mods() | get_weak_mods() | get_oneshot_mods();
 | 
			
		||||
  //if (keycode == OS_ODK && (mods & ~(MOD_MASK_SHIFT | MOD_BIT(KC_ALGR)))) { return true; }
 | 
			
		||||
  //if (keycode == OS_ODK && (mods & ~MOD_BIT(KC_ALGR))) { return true; }
 | 
			
		||||
 | 
			
		||||
  switch (keycode) {
 | 
			
		||||
    case OS_ODK:
 | 
			
		||||
      // On veut que la touche typo soit ignorée par tous les Callum mods sauf Alt-gr.
 | 
			
		||||
      // Ça permet de transmettre les mods à la touche suivante, par ex pour faire Ctrl + K. 
 | 
			
		||||
      // Alt-gr doit pouvoir s’appliquer à la touche typo, pour permettre de faire la touche morte "~" avec.
 | 
			
		||||
      // OS_ODK ne doit être ignored_key que lorsqu’elle est employée avec Alt-gr
 | 
			
		||||
      // sous peine de ne pas pouvoir faire shift + typo + touche de l'autre côté
 | 
			
		||||
      if (mods & ~MOD_BIT(KC_ALGR)) { return true; }
 | 
			
		||||
      break;
 | 
			
		||||
    //case OS_ODK:  /!\ A ne pas remettre, sous peine de ne pas pouvoir faire shift + typo + touche de l'autre côté
 | 
			
		||||
    case L_OS4A:
 | 
			
		||||
    case R_OS4A:
 | 
			
		||||
    case OS_SHFT:
 | 
			
		||||
| 
						 | 
				
			
			@ -267,7 +269,6 @@ bool is_oneshot_ignored_key(uint16_t keycode) {
 | 
			
		|||
    case OS_FA:
 | 
			
		||||
    case NUMWORD:
 | 
			
		||||
    case TG_FA:
 | 
			
		||||
    //case OS_WMNT:
 | 
			
		||||
      return true;
 | 
			
		||||
/*     default:
 | 
			
		||||
      return false; */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,8 +40,8 @@ bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) {
 | 
			
		|||
 | 
			
		||||
    if (record->event.key.col != next_record.event.key.col) {
 | 
			
		||||
 | 
			
		||||
      // La ligne suivante n'est nécessaire que si on a besoin de doubler rapidement un caractère présent sur la moitié droite du clavier.
 | 
			
		||||
      // Ce n'est pas nécessaire pour l'instant, vu que les guillemets sont passés à gauche.
 | 
			
		||||
      // Permet de doubler rapidement un caractère présent sur la moitié droite du clavier.
 | 
			
		||||
      // Fait également gagner pas mal de place sur le FW.
 | 
			
		||||
      if (keycode == OS_ODK) { return true; }
 | 
			
		||||
 | 
			
		||||
      if (forbidden_chord(keycode, record, next_keycode, &next_record)) {
 | 
			
		||||
| 
						 | 
				
			
			@ -55,16 +55,11 @@ bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) {
 | 
			
		|||
    return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) {
 | 
			
		||||
  return !forbidden_chord(keycode, record, next_keycode, &next_record);
 | 
			
		||||
} */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Matrix scan
 | 
			
		||||
 | 
			
		||||
void matrix_scan_user(void) {
 | 
			
		||||
  recent_keys_task();
 | 
			
		||||
  //swapper_task();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -52,7 +52,6 @@ enum custom_keycodes {
 | 
			
		|||
  OS4A,
 | 
			
		||||
  RAZ,
 | 
			
		||||
  CAPSWORD,
 | 
			
		||||
  MOD_ODK,
 | 
			
		||||
  OU_GRV,
 | 
			
		||||
  MAGIC,
 | 
			
		||||
  OS_SHFT,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue