qmk_firmware/keyboards/pabile/p20/keymaps/default/keymap.c
pabile d15a60d2d3
[Keyboard] Add P40, P20 and P18 Keyboards by pabile (#8759)
* Add files via upload

* removed

* Add files via upload

* Rename pabile40.c to p40.c

* Rename pabile40.h to p40.h

* Add files via upload

* Update p40.c

* Update p40.h

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Updated readme file

* Updated readme file

* Add files via upload

* modified:   keyboards/pabile/p18/config.h
	modified:   keyboards/pabile/p18/keymaps/default/keymap.c
	modified:   keyboards/pabile/p18/p18.h
	modified:   keyboards/pabile/p18/rules.mk
	modified:   keyboards/pabile/p40/config.h
	modified:   keyboards/pabile/p40/keymaps/default/keymap.c

* config update

* Delete README.md.save

* Delete keymap.c.save

* Delete keymaps.c

* modified:   keyboards/pabile/p18/keymaps/default/keymap.c

* Update p18.h

* testing layout config

* Create info.json

* Create info.json

* Create readme.md

* Update readme.md

* Updated description

* Updated description

* Update config.h

updated vendor ID to 0000

* Update keymap.c

removed unnecessary comments

* Update keyboards/pabile/p18/p18.h

* Update keyboards/pabile/p18/p18.h

* Update p18.h

removed unnecessary comments

* Update keyboards/pabile/p18/rules.mk

* Update keyboards/pabile/p18/rules.mk

* Update config.h

updated vendor id and removed unnecessary comments

* Update keyboards/pabile/p40/info.json

* Update keyboards/pabile/p40/keymaps/default/keymap.c

* Update keyboards/pabile/p40/p40.h

* Update keyboards/pabile/p40/p40.h

* Update keyboards/pabile/p40/p40.h

* Update keyboards/pabile/p40/rules.mk

* Update keyboards/pabile/p40/rules.mk

* Added p20 macropad

* Update README.md

* Updated VID and PID

* Updated VID and PID

* Update rules.mk

* Update config.h

* Update config.h

* Update config.h

* Update keymap.c

* Replaced blank keys with KC_NO

* Update keyboards/pabile/p18/keymaps/default/keymap.c

* Update keyboards/pabile/p18/p18.h

* Update keyboards/pabile/p18/rules.mk

* Update keyboards/pabile/p20/keymaps/default/keymap.c

* Update keymap.c

* Update keymap.c

* Update keyboards/pabile/p20/rules.mk

* Update keyboards/pabile/p40/info.json

* Update keyboards/pabile/p20/p20.h

* Updated product ID

* Updated product ID

* Update keyboards/pabile/p20/config.h

* Update keyboards/pabile/p20/p20.h

* Update keyboards/pabile/p20/p20.h

* Update keyboards/pabile/p20/keymaps/default/keymap.c

* Update keyboards/pabile/p18/readme.md

* Update keyboards/pabile/p20/README.md

* Update keyboards/pabile/p20/rules.mk

* Update keyboards/pabile/p20/rules.mk

* Update keyboards/pabile/p20/rules.mk

* Update keyboards/pabile/p20/rules.mk

* Update keyboards/pabile/p40/README.md

* Update keyboards/pabile/p40/rules.mk

* Update keyboards/pabile/p40/rules.mk

* Update keyboards/pabile/p18/rules.mk

* Update keyboards/pabile/p18/rules.mk

* Update keyboards/pabile/p40/config.h

* Update keyboards/pabile/p40/config.h

* Update keyboards/pabile/p18/readme.md

* Changed to lowercase filename

* Rename README.md to readme.md

* Update keyboards/pabile/p18/rules.mk
2020-05-09 21:46:17 -07:00

39 lines
1.2 KiB
C

#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_5x4(
KC_PSLS, KC_PMNS, KC_PAST, KC_MPLY,
KC_P7, KC_P8, KC_P9, KC_PMNS,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3, KC_TAB,
LT(2,KC_P0), KC_PCMM, KC_PDOT, LT(1,KC_PENT)),
[1] = LAYOUT_ortho_5x4(
KC_NLCK, KC_UNDS, KC_NO, KC_NO,
KC_AMPR, KC_ASTR, KC_LPRN, KC_EQL,
KC_DLR, KC_PERC, KC_CIRC, KC_NO,
KC_EXLM, KC_AT, KC_HASH, KC_NO,
KC_RPRN, KC_NO, KC_PSLS, KC_NO),
[2] = LAYOUT_ortho_5x4(
KC_NLCK, KC_NO, KC_NO, KC_NO,
KC_BTN1, KC_MS_U, KC_BTN2, KC_NO,
KC_MS_L, KC_MS_D, KC_MS_R, KC_TAB,
KC_WH_U, KC_NO, KC_WH_D, KC_NO,
KC_NO, KC_NO, KC_DEL, KC_ESC)
};
void encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_WH_U); /*mouse wheel up*/
} else {
tap_code(KC_WH_D); /*mouse wheel down */
}
} else if (index == 1) { /* Second encoder */
if (clockwise) {
tap_code(KC_VOLD); /*volume down*/
} else {
tap_code(KC_VOLU); /*volume up*/
}
}
}