logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

rev1.c (1475B)


  1. /* Copyright 2021 T.Shinohara
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include "rev1.h"
  17. bool is_mac_mode(void) {
  18. return keymap_config.swap_lalt_lgui == false;
  19. }
  20. void set_mac_mode(bool macmode) {
  21. if (macmode) {
  22. /* The result is the same as pressing the AG_NORM(=MAGIC_UNSWAP_ALT_GUI) key. */
  23. /* https://github.com/qmk/qmk_firmware/blob/fb4a6ad30ea7a648acd59793ed4a30c3a8d8dc32/quantum/process_keycode/process_magic.c#L123-L124 */
  24. keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = false;
  25. } else {
  26. /* The result is the same as pressing the AG_SWAP(=MAGIC_SWAP_ALT_GUI) key. */
  27. /* https://github.com/qmk/qmk_firmware/blob/fb4a6ad30ea7a648acd59793ed4a30c3a8d8dc32/quantum/process_keycode/process_magic.c#L80-L81 */
  28. keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = true;
  29. }
  30. }