Skip to content

Commit

Permalink
[Keyboard] Adding AEK64 keyboard (#6725)
Browse files Browse the repository at this point in the history
* Adding AEK64 keyboard

* Deleting useless layout definition

* Resolving many code review issues

* Documenting my 4sStylZ keymap

* Adding default keymap

* Apply suggestions from code review

Code review corrections

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
Co-Authored-By: fauxpark <fauxpark@gmail.com>

* Update keyboards/handwired/aek64/readme.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Correcting the NKRO implementation
  • Loading branch information
4sStylZ authored and drashna committed Sep 17, 2019
1 parent 32b2486 commit ab48ffd
Show file tree
Hide file tree
Showing 8 changed files with 361 additions and 0 deletions.
36 changes: 36 additions & 0 deletions keyboards/handwired/aek64/aek64.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright 2012,2013 Jun Wako <wakojun@gmail.com> <4sStylZ@protonmail.ch>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "quantum.h"

/*
* Hardware function pre initialisation.
* See https://docs.qmk.fm/#/custom_quantum_functions?id=example-keyboard_pre_init_user-implementation
*/
void keyboard_pre_init_user(void) {
// Call the keyboard pre init code.

// Set our LED pins as output
setPinOutput(C3);
}

void matrix_init_kb(void) {

// Flash the led 1 sec on startup.
writePinHigh(C3);
wait_ms(1000);
writePinLow(C3);
}
34 changes: 34 additions & 0 deletions keyboards/handwired/aek64/aek64.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
Copyright 2012,2013 Jun Wako <wakojun@gmail.com> <4sStylZ@protonmail.ch>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once

#include "quantum.h"

/* Alps64 physical definition macro */
#define LAYOUT( \
k00, k01, k02, k03 , k04 , k05 , k06, k07 , k08 , k09 , k010 , k011, k012, k013 , \
k10, k11, k12, k13 , k14 , k15 , k16, k17 , k18 , k19 , k110 , k111, k112, \
k20, k21, k22, k23 , k24 , k25 , k26, k27 , k28 , k29 , k210 , k211, k212, k213 , \
k30, k31, k32, k33 , k34 , k35 , k36, k37 , k38 , k39 , k310 , k311, k312, \
k40, k41, k42, k46, k411, k412, k413 \
) { \
{ k00, k01, k02, k03 , k04 , k05 , k06, k07 , k08 , k09 , k010 , k011, k012, k013 }, \
{ k10, k11, k12, k13 , k14 , k15 , k16, k17 , k18 , k19 , k110 , k111, k112, KC_NO }, \
{ k20, k21, k22, k23 , k24 , k25 , k26, k27 , k28 , k29 , k210 , k211, k212, k213 }, \
{ k30, k31, k32, k33 , k34 , k35 , k36, k37 , k38 , k39 , k310 , k311, k312, KC_NO }, \
{ k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, KC_NO, k411, k412, k413 }, \
}
78 changes: 78 additions & 0 deletions keyboards/handwired/aek64/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
Copyright 2015 Jun Wako <wakojun@gmail.com> <4sStylZ@protonmail.ch>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6464
#define DEVICE_VER 0x0001
#define MANUFACTURER 4sStylZ and others makers
#define PRODUCT AEK64
#define DESCRIPTION QMK keyboard firmware for AEK64 handwired

/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 14

// Originally made for a Teensy 2++
#define MATRIX_COL_PINS { F0, E6, E7, B0, B1, B2, B3, B4, B5, B6, B7, D0, D1, D2 }
#define MATRIX_ROW_PINS { E0, E1, C0, C1, C2 }
#define UNUSED_PINS

/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST

/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
// #define LOCKING_SUPPORT_ENABLE

/* Locking resynchronize hack */
//#define LOCKING_RESYNC_ENABLE

/* Enable the space-cadet options */
#define RSPC_KEYS KC_RSFT, KC_TRNS, KC_PGUP
#define RCPC_KEYS KC_RCTL, KC_TRNS, KC_PGDOWN
#define LSPO_KEYS KC_LSFT, KC_TRNS, KC_HOME
#define LCPO_KEYS KC_LCTL, KC_TRNS, KC_END

/* Enable double tab */
#define TAPPING_TERM 175

#define COMBO_COUNT 1

/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/

/* disable debug print */
//#define NO_DEBUG

/* disable print */
//#define NO_PRINT

/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
12 changes: 12 additions & 0 deletions keyboards/handwired/aek64/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"keyboard_name": "aek64",
"url": "",
"maintainer": "qmk",
"width": 14.75,
"height": 5,
"layouts": {
"LAYOUT": {
"layout": [{"label":"Esc", "x":0, "y":0, "w":1.25}, {"label":"1", "x":1.25, "y":0}, {"label":"2", "x":2.25, "y":0}, {"label":"3", "x":3.25, "y":0}, {"label":"4", "x":4.25, "y":0}, {"label":"5", "x":5.25, "y":0}, {"label":"6", "x":6.25, "y":0}, {"label":"7", "x":7.25, "y":0}, {"label":"8", "x":8.25, "y":0}, {"label":"9", "x":9.25, "y":0}, {"label":"0", "x":10.25, "y":0}, {"label":"\u00b0", "x":11.25, "y":0}, {"label":"+", "x":12.25, "y":0}, {"label":"Backspace", "x":13.25, "y":0, "w":1.75}, {"label":"Tab", "x":0, "y":1, "w":1.75}, {"label":"A", "x":1.75, "y":1}, {"label":"Z", "x":2.75, "y":1}, {"label":"E", "x":3.75, "y":1}, {"label":"R", "x":4.75, "y":1}, {"label":"T", "x":5.75, "y":1}, {"label":"Y", "x":6.75, "y":1}, {"label":"U", "x":7.75, "y":1}, {"label":"I", "x":8.75, "y":1}, {"label":"O", "x":9.75, "y":1}, {"label":"P", "x":10.75, "y":1}, {"label":"{", "x":11.75, "y":1}, {"label":"}", "x":12.75, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":2}, {"label":"Q", "x":2, "y":2}, {"label":"S", "x":3, "y":2}, {"label":"D", "x":4, "y":2}, {"label":"F", "x":5, "y":2}, {"label":"G", "x":6, "y":2}, {"label":"H", "x":7, "y":2}, {"label":"J", "x":8, "y":2}, {"label":"K", "x":9, "y":2}, {"label":"L", "x":10, "y":2}, {"label":"M", "x":11, "y":2}, {"label":"%", "x":12, "y":2}, {"label":"&micro;", "x":13, "y":2}, {"label":"Enter", "x":14, "y":1, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.5}, {"label":">", "x":1.5, "y":3}, {"label":"W", "x":2.5, "y":3}, {"label":"X", "x":3.5, "y":3}, {"label":"C", "x":4.5, "y":3}, {"label":"V", "x":5.5, "y":3}, {"label":"B", "x":6.5, "y":3}, {"label":"N", "x":7.5, "y":3}, {"label":"?", "x":8.5, "y":3}, {"label":".", "x":9.5, "y":3}, {"label":"/", "x":10.5, "y":3}, {"label":"&sect;", "x":11.5, "y":3}, {"label":"Shift", "x":12.5, "y":3, "w":2.5}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Opt", "x":1.5, "y":4, "w":1.25}, {"label":"Cmd", "x":2.75, "y":4, "w":1.5}, {"label":"Space", "x":4.25, "y":4, "w":6.5}, {"label":"Cmd", "x":10.75, "y":4, "w":1.5}, {"label":"Opt", "x":12.25, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}]
}
}
}
102 changes: 102 additions & 0 deletions keyboards/handwired/aek64/keymaps/4sstylz/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#include QMK_KEYBOARD_H

// Implement Super-alt↯tab
// See https://docs.qmk.fm/#/feature_macros?id=super-alt↯tab
bool is_alt_tab_active = false;
uint16_t alt_tab_timer = 0;

// Defining all the custom keycodes.
enum custom_keycodes {
ALT_TAB = SAFE_RANGE
};

const uint16_t PROGMEM lock_combo[] = {KC_J, KC_K, KC_L, KC_SCLN, COMBO_END};
combo_t key_combos[COMBO_COUNT] = {COMBO(lock_combo, LGUI(KC_O))};

// Define the keycodes for one qwerty layer and one Fn layer.
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: qwerty
* ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬─────────────┐
* │ ` Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Bksp │
* ├─────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼─────┬───────┤
* │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │
* ├─────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼─────┴┐ Enter│
* │ Layer 2 │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │
* ├──────┬──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┴──────┴──────┤
* │ Shift│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift │
* ├──────┼──────┼──────┼──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┼──────┬──────┬──────┤
* │ Ctrl │ Alt │↯ATab │ Space │ Gui │ Alt │ Ctrl │
* └──────┴──────┴──────┴──────────────────────────────────────────────────────────────┴──────┴──────┴──────┘
*
* Hidden features : 
* - Left Shift is also Home on a single tap.
* - Left Ctrl is also End on a single tap.
* - Right Shift is also page-up on a single tap.
* - Right Ctrl is also page-down on a single tap.
* - Press JKLM for Windows + L (Session lock)
*/
[0] = LAYOUT( \
KC_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_BSPC,
KC_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,
MO(1) , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT ,
KC_LSPO , KC_NUBS, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSPC ,
KC_LCPO , KC_LALT, ALT_TAB, KC_SPC, KC_LGUI, KC_RALT, KC_RCPC
),

/* 1: second layer for media keys and many advanced features ç
* ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬─────────────┐
* │Alt F4│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │
* ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼─────┬───────┤
* │ │ │ │PrtScn│ Brt+ │ Brt- │Ctrl A│ Home │ Up │ End │ ‽  │ ↑     │ ⸮   │ │ │
* ├─────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼─────┴┐ │
* │ │ Cut │ Copy │Paste │ Del │ Del │ Left │ Down │Right │ ← │ ↓ │ → │ │ │
* ├──────┬──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┴──────┴──────┤
* │ │ │ Mute │ Vol- │ Vol+ │ │ │ │ │ │ │Reset │ │
* ├──────┼──────┼──────┼──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┼──────┬──────┬──────┤
* │ │ │ │ │ │ │ │
* └──────┴──────┴──────┴──────────────────────────────────────────────────────────────┴──────┴──────┴──────┘
*/
[1] = LAYOUT( \
LALT(KC_F4), KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , _______,
_______ , _______ , _______ , KC_PSCR , KC_BRIU , KC_BRID, LCTL(KC_A), KC_HOME, KC_UP , KC_END , UC(0x203D) , UC(0x8593), UC(0x2E2E),
_______ , _______ , LSFT(KC_DEL), LCTL(KC_INS), LSFT(KC_INS), KC_DEL , KC_DEL , KC_LEFT, KC_DOWN, KC_RIGHT, UC(0x8592) , UC(0x8595), UC(0x8594), _______,
_______ , _______ , KC_MUTE , KC_VOLD , KC_VOLU , _______, _______ , _______, _______, _______ , _______ , RESET , _______ ,
_______ , _______ , _______ , _______, _______ , _______ , _______
)
};

// Set the unicode input mode for using UC.
void matrix_init_user(void) {
set_unicode_input_mode(UC_LNX);
}

// Processing all the key pressed.
// Alt+tab.
bool process_record_user(uint16_t keycode, keyrecord_t *record) {

// Depending keycodes…
switch (keycode) { // This will do most of the grunt work with the keycodes.
case ALT_TAB:
if (record->event.pressed) {
if (!is_alt_tab_active) {
is_alt_tab_active = true;
register_code(KC_LALT);
}
alt_tab_timer = timer_read();
register_code(KC_TAB);
} else {
unregister_code(KC_TAB);
}
break;
}
return true;
}

void matrix_scan_user(void) { // The very important timer.
if (is_alt_tab_active) {
if (timer_elapsed(alt_tab_timer) > 750) {
unregister_code(KC_LALT);
is_alt_tab_active = false;
}
}
}
Loading

0 comments on commit ab48ffd

Please sign in to comment.