keymap_unicode.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. Copyright 2015 Jack Humbert <jack.humb@gmail.com>
  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. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #include "keymap_common.h"
  15. void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
  16. {
  17. if (record->event.pressed) {
  18. uint16_t unicode = (opt << 8) | id;
  19. register_code(KC_LALT);
  20. register_code(hextokeycode((unicode & 0xF000) >> 12));
  21. unregister_code(hextokeycode((unicode & 0xF000) >> 12));
  22. register_code(hextokeycode((unicode & 0x0F00) >> 8));
  23. unregister_code(hextokeycode((unicode & 0x0F00) >> 8));
  24. register_code(hextokeycode((unicode & 0x00F0) >> 4));
  25. unregister_code(hextokeycode((unicode & 0x00F0) >> 4));
  26. register_code(hextokeycode((unicode & 0x000F)));
  27. unregister_code(hextokeycode((unicode & 0x000F)));
  28. /* Test 'a' */
  29. // register_code(hextokeycode(0x0));
  30. // unregister_code(hextokeycode(0x0));
  31. // register_code(hextokeycode(0x0));
  32. // unregister_code(hextokeycode(0x0));
  33. // register_code(hextokeycode(0x6));
  34. // unregister_code(hextokeycode(0x6));
  35. // register_code(hextokeycode(0x1));
  36. // unregister_code(hextokeycode(0x1));
  37. unregister_code(KC_LALT);
  38. }
  39. return;
  40. }