]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c
2ddf8acb41071b224a1c87a76336f7a47213265e
[qmk_firmware.git] / keyboards / 1upkeyboards / sweet16 / keymaps / default / keymap.c
1 #include "sweet16.h"
2
3 enum custom_keycodes {
4   UP_URL = SAFE_RANGE
5 };
6
7 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
8     LAYOUT_ortho_4x4(
9         KC_7, KC_8,   KC_9,   KC_ASTR, 
10         KC_4, KC_5,   KC_6,   KC_SLSH, 
11         KC_1, KC_2,   KC_3,   KC_MINS, 
12         KC_0, KC_ENT, KC_DOT, KC_EQL
13     )
14 };
15
16 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
17     switch (keycode) {
18         case UP_URL:
19             if (record->event.pressed) {
20                 SEND_STRING("http://1upkeyboards.com");
21             }
22             return false;
23             break;
24     }
25     return true;
26 }
27
28 void led_set_user(uint8_t usb_led) {
29
30   /* Map RXLED to USB_LED_NUM_LOCK */
31         if (usb_led & (1 << USB_LED_NUM_LOCK)) {
32                 DDRB |= (1 << 0); PORTB &= ~(1 << 0);
33         } else {
34                 DDRB &= ~(1 << 0); PORTB &= ~(1 << 0);
35         }
36
37   /* Map TXLED to USB_LED_CAPS_LOCK */
38         if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
39                 DDRD |= (1 << 5); PORTD &= ~(1 << 5);
40         } else {
41                 DDRD &= ~(1 << 5); PORTD &= ~(1 << 5);
42         }
43 }