Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Aplusx Pulsar XBOARD QS keyboard #23756

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

skylupin03
Copy link

@skylupin03 skylupin03 commented May 21, 2024

Description

This is a PR to add the keyboard "Aplusx, PULSAR XBOARD QS" to QMK.

Thank you for taking the time to review this submission

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added keyboard keymap via Adds via keymap and/or updates keyboard for via support labels May 21, 2024
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can rename this to keyboard.json, and remove the rules.mk file.

Comment on lines +21 to +23
enum pulsar_keycodes {
KC_TGUI = SAFE_RANGE, // Toggle between GUI Lock or Unlock
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
enum pulsar_keycodes {
KC_TGUI = SAFE_RANGE, // Toggle between GUI Lock or Unlock
};


//-----------------------------------------------------------------------------

#ifdef RGB_MATRIX_ENABLE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be moved to the keyboard's c file (and that file created)

enum _layer { WIN_BASE = 0, WIN_FN, MAC_BASE, MAC_FN };

enum pulsar_keycodes {
KC_TGUI = QK_KB_0, // Ver 0.21.6에서 변경 (USER00,) // Toggle between GUI Lock or Unlock
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a keyboard keycode, not a keymap/user keycode.

Suggested change
KC_TGUI = QK_KB_0, // Ver 0.21.6에서 변경 (USER00,) // Toggle between GUI Lock or Unlock
KC_TGUI = QK_USER_0, // Ver 0.21.6에서 변경 (USER00,) // Toggle between GUI Lock or Unlock

Comment on lines +82 to +107
void kvm_switch(bool pc_num){
writePinHigh(GPIO_KM_OE);
writePinLow(GPIO_KM_PWEN);
if (!pc_num) writePinLow(GPIO_KM_SEL);
else writePinHigh(GPIO_KM_SEL);
writePinLow(GPIO_KM_OE);

kvm_timer = timer_read();
kvm_sel_on = true;
};

void keyboard_pre_init_user(void) {
setPinOutput(GPIO_KM_OE); // H/W power on default = 0
setPinOutput(GPIO_KM_SEL); // H/W power on default = 0
setPinOutput(GPIO_KM_PWEN); // H/W power on default = 1
}

void keyboard_post_init_user(void) {
user_config.raw = eeconfig_read_user(); // Read the user config from EEPROM
kvm_pc_sel = user_config.eeprom_kvm_pc_sel;
kvm_switch(kvm_pc_sel);

Status_LED_Bright = user_config.eeprom_Status_LED_Bright; // 0 = 초기값, 1~5 = 50~250의 5단계 밝기
if (Status_LED_Bright == 0) Status_LED_Bright = 5;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code should exist at the kb level, not the keymap.

Comment on lines +168 to +174
return false;
}
else{
INIT3S_on = false;
return false;
}
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return false;
}
else{
INIT3S_on = false;
return false;
}
break;
}
else{
INIT3S_on = false;
}
break;

Comment on lines +185 to +194
case KC_LOPTN:
case KC_ROPTN:
case KC_LCMMD:
case KC_RCMMD:
if (record->event.pressed) {
register_code(mac_keycode[keycode - KC_LOPTN]);
} else {
unregister_code(mac_keycode[keycode - KC_LOPTN]);
}
return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be a poor implementation of the magic functionality.

https://docs.qmk.fm/keycodes_magic

And specifically, the Alt-GUI swap functionality


case KC_TMODE:
if (record->event.pressed) {
switch (get_highest_layer(layer_state|default_layer_state)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so ....

if (get_highest_layer(layer_state|default_layer_state) >= 2) {
   // not mac mode
} else {
   // is mac mode
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Via keymap should be plain and simple. Most of this code is either replicating core functionality, or is code that should absolutely not be implemented at the keymap level and should be at the kb level.

@drashna drashna added the pr_checklist_pending Needs changes as per the PR checklist label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keyboard keymap pr_checklist_pending Needs changes as per the PR checklist via Adds via keymap and/or updates keyboard for via support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants