{"id":216,"date":"2018-03-29T23:51:21","date_gmt":"2018-03-30T03:51:21","guid":{"rendered":"https:\/\/www.dev-notes.com\/blog\/?p=216"},"modified":"2018-03-30T10:39:32","modified_gmt":"2018-03-30T14:39:32","slug":"customizing-a-dz60-keyboard-using-qmk","status":"publish","type":"post","link":"https:\/\/www.dev-notes.com\/blog\/2018\/03\/29\/customizing-a-dz60-keyboard-using-qmk\/","title":{"rendered":"Customizing a DZ60 Keyboard using QMK"},"content":{"rendered":"<p>This is my 60% keyboard built on the DZ60 Rev 2.0 printed circuit board.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dev-notes.com\/blog\/wp-content\/uploads\/2018\/03\/20180330-Keyboard-1024x576.jpg\" alt=\"\" width=\"525\" height=\"295\" class=\"alignnone size-large wp-image-223\" srcset=\"https:\/\/www.dev-notes.com\/blog\/wp-content\/uploads\/2018\/03\/20180330-Keyboard-1024x576.jpg 1024w, https:\/\/www.dev-notes.com\/blog\/wp-content\/uploads\/2018\/03\/20180330-Keyboard-300x169.jpg 300w, https:\/\/www.dev-notes.com\/blog\/wp-content\/uploads\/2018\/03\/20180330-Keyboard-768x432.jpg 768w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/p>\n<p>These are the steps I took to configure it for my use.  Please note that I had configured this keyboard using Linux; Windows and Mac alternatives exist, but they are outside the scope of this article.<\/p>\n<p>1. The DZ60 can be customized using Quantum Mechanical Keyboard Firmware.  I downloaded a copy of it here: <a href=\"https:\/\/github.com\/qmk\/qmk_firmware\/zipball\/master\" rel=\"noopener\" target=\"_blank\">https:\/\/github.com\/qmk\/qmk_firmware\/zipball\/master<\/a>.<\/p>\n<p>2. I then unzipped the files to ~\/software\/qmk\/<\/p>\n<p>3. Run this shell script to ensure all dependencies are installed:<\/p>\n<pre>\r\nsudo ~\/software\/qmk\/util\/install_dependencies.sh\r\n<\/pre>\n<p>4. Create a folder that will hold my custom keymapping file: ~\/software\/qmk\/keyboards\/dz60\/keymaps\/cpc1\/keymap.c<\/p>\n<p>I am utilizing 4 layers.  Generally speaking:<\/p>\n<p>Layer 0 is the main layer containing QWERTY and other such keys that I will use most often.<\/p>\n<p>Layer 1 is activated by holding the key located beneath B.  This layer contains F1-F12, basic navigation (ESDF for cursor movement, page up\/down), volume control, and number pad (at right hand home row region).<\/p>\n<p>Layer 2 is activated by holding the key located beneath NM..  This layer contains mouse navigation keys (ESDF for mouse movement, XCV as the three mouse buttons).<\/p>\n<p>Layer 3 is activated by holding the key located beneath ENTER and to the right of UP.  This layer contains keyboard hardware control keys (reset, LED controls).<\/p>\n<p>This is my full keymap.c file:<\/p>\n<pre>\r\n#include \"dz60.h\"\r\n#define __      KC_TRNS\r\n#define ___     KC_TRNS\r\n#define _______ KC_TRNS\r\n#define HY      KC_HYPR\r\n#define LST     KC_LSFT\r\n#define SP_MO1  LT(1, KC_SPC)\r\n#define BS_MO2  LT(2, KC_BSPC)\r\n#define PN_MO3  LT(3, KC_PSCR)\r\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\r\n\r\n\t\/\/ Layer 0 - Standard keyboard\r\n\tKEYMAP_2_SHIFTS(\r\n\t\tKC_GESC, KC_1   , KC_2   , KC_3   , KC_4   , KC_5   , KC_6   , KC_7   , KC_8   , KC_9   , KC_0   , KC_MINS, KC_EQL , KC_DEL , KC_INS, \r\n\t\tKC_TAB , KC_Q   , KC_W   , KC_E   , KC_R   , KC_T   , KC_Y   , KC_U   , KC_I   , KC_O   , KC_P   , KC_LBRC, KC_RBRC, KC_BSLS, \r\n\t\tKC_ESC , KC_A   , KC_S   , KC_D   , KC_F   , KC_G   , KC_H   , KC_J   , KC_K   , KC_L   , KC_SCLN, KC_QUOT, KC_ENT , \r\n\t\tHY, LST, KC_Z   , KC_X   , KC_C   , KC_V   , KC_B   , KC_N   , KC_M   , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_UP  , PN_MO3 ,\r\n\t\tKC_LCTL, KC_LGUI, KC_LALT, KC_SPC , SP_MO1 , BS_MO2 , KC_HOME, KC_END , KC_LEFT, KC_DOWN, KC_RGHT),\r\n\r\n\t\/\/ Layer 1 - Cursor Navigation, Volume, Number Pad\r\n\tKEYMAP_2_SHIFTS(\r\n\t\t_______, KC_F1  , KC_F2  , KC_F3  , KC_F4  , KC_F5  , KC_F6  , KC_F7  , KC_F8  , KC_F9  , KC_F10 , KC_F11 , KC_F12 , _______, _______, \r\n\t\tKC_TAB , KC_HOME, KC_PGUP, KC_UP  , KC_PGDN, _______, _______, KC_7   , KC_8   , KC_9   , KC_PPLS, KC_PMNS, _______, _______, \r\n\t\t_______, KC_END , KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_4   , KC_5   , KC_6   , KC_PAST, KC_PSLS, KC_PENT, \r\n\t\tHY, LST, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_1   , KC_2   , KC_3   , _______, _______, _______, _______, \r\n\t\tKC_LCTL, KC_LGUI, KC_LALT, _______, _______, KC_0   , KC_PDOT, _______, _______, _______, _______),\r\n\r\n\t\/\/ Layer 2 - Mouse Navigation\r\n\tKEYMAP_2_SHIFTS(\r\n\t\t_______, _______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \r\n\t\tKC_TAB , _______, _______, KC_MS_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \r\n\t\t_______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, _______, _______, _______, _______, \r\n\t\tHY, LST, _______, KC_BTN1, KC_BTN3, KC_BTN2, _______, _______, _______, _______, _______, _______, _______, _______, _______, \r\n\t\tKC_LCTL, KC_LGUI, KC_LALT, _______, _______, _______, _______, _______, _______, _______, _______),\r\n\r\n\r\n\t\/\/ Layer 3 - Keyboard Hardware Controls\r\n\tKEYMAP_2_SHIFTS(\r\n\t\tRESET  , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \r\n\t\t_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \r\n\t\t_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, \r\n\t\t__, ___, BL_TOGG, BL_DEC , BL_INC , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \r\n\t\t_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),\r\n};\r\n<\/pre>\n<p>5. Open a terminal window and navigate to ~\/software\/qmk\/<\/p>\n<p>6a. Run this command if you just want to create a hex file without actually flashing the keyboard:<\/p>\n<pre>\r\nsudo make dz60:cpc1\r\n<\/pre>\n<p>6b. Or, hold spacebar and B on the keyboard while plugging it into your computer; this will start the keyboard in bootloader mode.  Now I can run the following command to compile the hex and then flash it onto the keyboard:<\/p>\n<pre>\r\nsudo make dz60:cpc1:dfu\r\n<\/pre>\n<p>6c. Or, if the keyboard is already plugged in and in use, run this command (same as 5b above).  When the hex is built, it will prompt you to reset the keyboard so that the hex can be flashed onto the keyboard.  In my case, my reset button is in Layer 3, as noted earlier.<\/p>\n<pre>\r\nsudo make dz60:cpc1:dfu\r\n<\/pre>\n<p>Additional info:<\/p>\n<p>Full Documentation: <a href=\"https:\/\/docs.qmk.fm\" rel=\"noopener\" target=\"_blank\">https:\/\/docs.qmk.fm<\/a><br \/>\nGitHub of QMK Project: <a href=\"https:\/\/github.com\/qmk\/qmk_firmware\/\" rel=\"noopener\" target=\"_blank\">https:\/\/github.com\/qmk\/qmk_firmware\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article chronicles the steps I took to flash my custom keymapping onto my DZ60 keyboard.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,45],"tags":[],"class_list":["post-216","post","type-post","status-publish","format-standard","hentry","category-linux","category-qmk"],"_links":{"self":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts\/216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/comments?post=216"}],"version-history":[{"count":4,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts\/216\/revisions"}],"predecessor-version":[{"id":225,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts\/216\/revisions\/225"}],"wp:attachment":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/media?parent=216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/categories?post=216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/tags?post=216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}