How to build your very own keyboard firmware
- matt3o
- -[°_°]-
- Location: Italy
- Main keyboard: WhiteFox
- Main mouse: Anywhere MX
- Favorite switch: Anything, really
- DT Pro Member: 0030
- Contact:
I updated the windows section, I haven't tested atmelstudio personally, but it looks the best options for windows. Please let me know how it works for you.
- scottc
- ☃
- Location: Remote locations in Europe
- Main keyboard: GH60-HASRO 62g Nixies, HHKB Pro1 HS, Novatouch
- Main mouse: Steelseries Rival 300
- Favorite switch: Nixdorf 'Soft Touch' MX Black
- DT Pro Member: -
Last time I did this on Windows for a friend, I used the now-native "Bash for Ubuntu for Windows 10" and just installed all of the Linux packages. Worked perfectly for everything apart from flashing, which I did with some standard GUI tool.
-
- Location: Australia
- DT Pro Member: -
No way. If this keyboard works I praise you mate, I'll praise you all the way. The compiling worked lets see if the keyboard works now !!!
YAY it works! Just a few keys must be soldered badly but it works <3!!!
-
- Location: Australia
- DT Pro Member: -
I am glad I could help with my very little knowledge mate!TenkaiX wrote: ↑No way. If this keyboard works I praise you mate, I'll praise you all the way. The compiling worked lets see if the keyboard works now !!!
YAY it works! Just a few keys must be soldered badly but it works <3!!!
- hasu
- Location: Japan
- Main keyboard: HHKB
- Main mouse: HHKB
- Favorite switch: Topre
- DT Pro Member: -
I couldn't find the posts in this thread, where are the posts you are refering? Can you post a link?Rejerh wrote: ↑Has anyone attempted to use some sort of backlight with just one PWM pin?
I saw the numerous posts from ROFLmonster which are quite interesting.
Unfortunately I don't understand much of what he did in the part where he manages the led strip and changes the colors and all.
You can start learning from Arduino repository if you are familiar with it. And consult with datasheet of your controller ATmega32u4.(maybe, "15. 10-bit High Speed Timer/Counter4"?)In my current set up I have all my leds connected to the +5V while I have a transistor on a PWM pin (PD7 of the teensy 2.0).
The idea is to change the leds' intensity by changing the frequency at which the transistor opens and closes (pretty simple and classic stuff I think). All leds will have the same intensity but I don't mind at all.
I am not sure where to start. At the moment I have something a bit silly where I have set up the pin (PD7) to HIGH when I press the capslock key. This is allowing to have the keyboard lighted up but I cannot control intensity nor switch it back off without unplugging the keyboard.
Using layers and FN keys like ROFLmonster did sounds like a good idea but I am not sure how to manage the PWM value (Arduino made that really simple with the analogWrite(), not sure how to do that within AVR).
Can someone help me out please?
https://github.com/arduino/Arduino/blob ... log.c#L104
-
- Location: Australia
- DT Pro Member: -
Hey Hasu, sorry for not quoting the posts.ROFLmonster wrote: ↑No problem, but it fits my specific layout and pinout (which is also included as a .PNG), not sure how that'll help you.
The .rar contains only the modified GH60 library since I didn't change anything else, including the WS2812B RGB LED strip libraries I used which can be found in full here: https://github.com/cpldcpu/light_ws2812 ... apa102_AVR
It's a bit messy, towards the end I just wanted to finish everything, but if something's not clear I'd be glad to help.
Mediafire link just in case:
http://www.mediafire.com/download/r958zpn0tw2g65p
In the pages 3-5 of this thread there are a few exchanges which ends with this last post where ROFLmonster posts his code. In it there is some code that manages his Led strip which I don't really understand.
As for my problem, I will check the link that you posted from Arduino.
Thanks a lot!
-
- Location: Australia
- DT Pro Member: -
For whoever is interested, after quite some difficulties and still wondering how everything works I managed to make my backlight work.
My set up is as follows:
1- All my 69 Leds with some resistors in series (be careful to take strong enough resistors so you don't try to get more than 500mA out of the USB port) are connected in parallel to the VCC and to one of the outside pins of a transistor (not the middle one).
2- The transistor has its middle pin connected to PD7 on a teensy 2.0 and its last pin connected to the GND.
The idea is to control the PWM on the PD7 to make the transistor open and close more or less to control the brightness of the Leds
To do this I have followed the implementation of ROFLmonster (see in this Thread on page 3-5).
1- I have added a backlight.h in the same folder as keymap_poker.c.
Here is the code in it:
2- I have modified my keymap_poker.c to manage tap actions on FN key strokes. To do that I have added 2 FN layers.
The first one has all the features I wanted from my FN0 key and the second one has the controlling FN keys (2-5) that will modify the brightness of my LEDS.
Here is the code:
I hope it will help someone. At least it works great for me.
Thanks to hasu and flabbergast for pointing me in the right directions!
My set up is as follows:
1- All my 69 Leds with some resistors in series (be careful to take strong enough resistors so you don't try to get more than 500mA out of the USB port) are connected in parallel to the VCC and to one of the outside pins of a transistor (not the middle one).
2- The transistor has its middle pin connected to PD7 on a teensy 2.0 and its last pin connected to the GND.
The idea is to control the PWM on the PD7 to make the transistor open and close more or less to control the brightness of the Leds
To do this I have followed the implementation of ROFLmonster (see in this Thread on page 3-5).
1- I have added a backlight.h in the same folder as keymap_poker.c.
Here is the code in it:
Code: Select all
#define BACKLIGHT_OFF 2
#define BACKLIGHT_ON 3
#define BACKLIGHT_INCREASE 4
#define BACKLIGHT_DECREASE 5
void decrease(void);
void increase(void);
void turn_off();
void turn_on(void);
void set_pwm_value(void);
void init_pwm(void);
The first one has all the features I wanted from my FN0 key and the second one has the controlling FN keys (2-5) that will modify the brightness of my LEDS.
Here is the code:
Code: Select all
#include "keymap_common.h"
#include <avr/io.h>
#include "backlight.h"
#include <stdlib.h>
#include <time.h>
const int step = 205;
int pwm_cycle = 0; //full cycle is reached at 2047
int is_init = 0;
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, INS, HOME, \
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLASH, DEL, END, \
CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, \
LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, \
LCTL, LGUI, LALT, SPC, RALT, FN0, RCTL, LEFT, DOWN, RIGHT),
/* 1: FN 1 */
KEYMAP(GRAVE, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, MEDIA_PLAY_PAUSE, PGUP, \
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PSCR, SLCK, PAUSE, FN1, MEDIA_STOP, PGDN, \
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \
LSFT, TRNS, TRNS, CALC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RSFT, VOLU, \
LCTL, APP, LALT, TRNS, RALT, TRNS, RCTL, MEDIA_PREV_TRACK, VOLD, MEDIA_NEXT_TRACK),
/* 2: FN 2 */
KEYMAP(GRAVE, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, MEDIA_PLAY_PAUSE, PGUP, \
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PSCR, SLCK, PAUSE, TRNS, MEDIA_STOP, PGDN, \
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \
LSFT, TRNS, TRNS, CALC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RSFT, FN4, \
LCTL, APP, LALT, TRNS, RALT, TRNS, RCTL, FN2, FN5, FN3),
};
const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_MOMENTARY(2),
[2] = ACTION_FUNCTION_TAP(BACKLIGHT_OFF),
[3] = ACTION_FUNCTION_TAP(BACKLIGHT_ON),
[4] = ACTION_FUNCTION_TAP(BACKLIGHT_INCREASE),
[5] = ACTION_FUNCTION_TAP(BACKLIGHT_DECREASE),
};
int min(int a, int b)
{
if (a <= b){return a;}
else{return b;}
}
int max(int a, int b)
{
if (a >= b){return a;}
else{return b;}
}
void init_pwm()
{
DDRD |= (1 << 7);
TCCR4B = 0x01;
TCCR4C = 0x09;
TCCR4D = 0x00;
TCCR4E = 0x40;
TC4H = 7;
OCR4C = 0xFF;
is_init = 1;
}
void turn_off()
{
pwm_cycle = 0;
set_pwm_value();
}
void turn_on()
{
pwm_cycle = 2047;
set_pwm_value();
}
void set_pwm_value()
{
if(!is_init)
{
init_pwm();
}
pwm_cycle = min(max(0, pwm_cycle),2047);
pwm_cycle &= 0x7FF; // restrict to 11 bits
TC4H = (pwm_cycle >> 8);
OCR4D = pwm_cycle & 0x00FF;
}
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
switch (id)
{
case BACKLIGHT_OFF:
turn_off(0);
break;
case BACKLIGHT_ON:
turn_on();
break;
case BACKLIGHT_INCREASE:
increase();
break;
case BACKLIGHT_DECREASE:
decrease();
break;
default:
turn_off(0);
break;
}
}
void increase()
{
pwm_cycle = pwm_cycle + step;
set_pwm_value();
}
void decrease()
{
pwm_cycle = pwm_cycle - step;
set_pwm_value();
}
Thanks to hasu and flabbergast for pointing me in the right directions!
-
- Location: Oklahoma City
- Main keyboard: CMStorm
- Favorite switch: blue
- DT Pro Member: -
I apologize if this is not the right sub to post this question, but I'm stuck and couldn't find a more appropriate place
Using the following matrix wired to my Teensy 2.0 as indicated:
I'm having a hard time figuring out exactly how to make this work using Haus's Keyboard Firmware (https://github.com/tmk/tmk_keyboard)
I've attempted to make the appropriate adjustments to the matrix and layout within the code, but for some reason caps is now "J" and alt is "K". That's all I've managed to get working so far.
I was wondering if anyone could offer some pointers or possibly insight on what I should modify to get this working?
Thank you!
Using the following matrix wired to my Teensy 2.0 as indicated:
I'm having a hard time figuring out exactly how to make this work using Haus's Keyboard Firmware (https://github.com/tmk/tmk_keyboard)
I've attempted to make the appropriate adjustments to the matrix and layout within the code, but for some reason caps is now "J" and alt is "K". That's all I've managed to get working so far.
I was wondering if anyone could offer some pointers or possibly insight on what I should modify to get this working?
Thank you!
-
- Location: Australia
- DT Pro Member: -
Hello,
So you're using hasu's code not gh60?
If you're using gh60 I could possibly help you write up a bit of code in my spare time.
I too was struggling but with the help of Hasu, Matt3o and Rejerh I created my very own keyboard
Hopefully I didn't reply too late >.<
So you're using hasu's code not gh60?
If you're using gh60 I could possibly help you write up a bit of code in my spare time.
I too was struggling but with the help of Hasu, Matt3o and Rejerh I created my very own keyboard
Hopefully I didn't reply too late >.<
- hasu
- Location: Japan
- Main keyboard: HHKB
- Main mouse: HHKB
- Favorite switch: Topre
- DT Pro Member: -
Hi,
I made virtualbox VM image for compile source codes the other day.
Try this if you have trouble on setup GCC toolchain and development tools.
https://github.com/tmk/tmk_keyboard/wik ... VirtualBox
I tested this on Windows10 but it should work on Mac too.
Also check here.
https://github.com/tmk/tmk_keyboard/wiki#build-firmware
I made virtualbox VM image for compile source codes the other day.
Try this if you have trouble on setup GCC toolchain and development tools.
https://github.com/tmk/tmk_keyboard/wik ... VirtualBox
I tested this on Windows10 but it should work on Mac too.
Also check here.
https://github.com/tmk/tmk_keyboard/wiki#build-firmware
-
- Chasing the Dream
- Location: Berlin
- Main keyboard: redscarf III
- DT Pro Member: -
I have a problem, my satan gh60 didn't work correct. I changed the files of the qmk satan gh60 rgb keyboard firmware, everthing functioned fine, after I flashed the firmware (linux) it didn't work. The keyboard worked some months ago pretty good, but for stupid reasons I erased the firmware and the original files are used are not anymore existend. Now the most keys dont work and the 4-5 that work puts out the wrong characters, for example the "r" a "s". Is there something wrong in my keymap (I tried the stock hex files and then my modified ones, but no difference). The rgb strip work and I just modified the keymap and satan.h.
That is my keyboard:
satan.h
Would be fine if somebody can help me.
That is my keyboard:
Spoiler:
Code: Select all
#ifndef SATAN_H
#define SATAN_H
#include "matrix.h"
#include "keymap_common.h"
#include "backlight.h"
#include "rgblight.h"
#include <stddef.h>
// This a shortcut to help you visually see your layout.
// The following is an example using the Planck MIT layout
// The first section contains all of the arguements
// The second converts the arguments into a two-dimensional array
#define KEYMAP( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \
k40, k42, k46, k4b, k4d\
) \
{ \
{k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \
{k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \
{k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, KC_NO}, \
{k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d}, \
{k40, KC_NO, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, KC_NO, k4b, KC_NO, k4d} \
}
void * matrix_init_user(void);
void * matrix_scan_user(void);
#endif
//#define KEYMAP( \
// k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \
// k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \
// k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
// k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \
// k40, k42, k46, k4b, k4d \
//) \
//{ \
// {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \
// {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \
// {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, KC_NO}, \
// {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d}, \
// {k40, KC_NO, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, KC_NO, k4b, KC_NO, k4d} \
//}
Code: Select all
// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
// this is the style you want to emulate.
#include "satan.h"
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _BW 0
#define _FL 1
// #define _MV 3
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BW: (Base Windows) Windows Default Layer
* ,-----------------------------------------------------------.
* |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp|Backsp (!!!NOTE!!! THE RIGHT MOST BUTTON ON THE SPLIT BS IS k49 on the grid (satan.h)!!|
* |-----------------------------------------------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|
* |-----------------------------------------------------------|
* |CAPS/FL| A| S| D| F| G| H| J| K| L| ;| '|Return |
* |-----------------------------------------------------------|
* |Shift|shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Backlight step|
* |-----------------------------------------------------------|
* |Ctrl|Gui |Alt | Space |Alt |FN |CTRL |
* `-----------------------------------------------------------'
*
*/
[_BW] = KEYMAP(
F(0), 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, KC_ENT, \
KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, \
KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
KC_LCTL, KC_LALT, KC_SPC, KC_RALT, MO(1) ),
/* Keymap _FL: Function Layer
* ,-----------------------------------------------------------.
* | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete |
* |-----------------------------------------------------------|
* | | |Up | f(1)|f(2)|f(3)|f(4)|f(5)|f(6)|f(7)|f(8)|BL_DEC|BL_INC|BL_TOGG|
* |-----------------------------------------------------------|
* | |Lef|Dow|Rig| | | | | | |home| pgup|BL_STEP |
* |-----------------------------------------------------------|
* | | | | | | | | | | | end| pgdn | | |
* |-----------------------------------------------------------|
* | | | | | | | |
* `-----------------------------------------------------------'
*/
[_FL] = KEYMAP(
KC_GRV, 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_DEL, \
KC_TRNS, KC_TRNS, KC_UP, F(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), BL_DEC, BL_INC, BL_TOGG, \
KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, BL_STEP, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
};
enum function_id {
SHIFT_ESC,
RGBLED_TOGGLE,
RGBLED_STEP_MODE,
RGBLED_INCREASE_HUE,
RGBLED_DECREASE_HUE,
RGBLED_INCREASE_SAT,
RGBLED_DECREASE_SAT,
RGBLED_INCREASE_VAL,
RGBLED_DECREASE_VAL,
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(SHIFT_ESC),
[1] = ACTION_FUNCTION(RGBLED_TOGGLE),
[2] = ACTION_FUNCTION(RGBLED_STEP_MODE),
[3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
[4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
[5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
[6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
[7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
[8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
// [9] = ACTION_LAYER_ON(_FL, ON_PRESS),
// [10] = ACTION_LAYER_OFF(_FL, ON_PRESS),
// [11] = ACTION_LAYER_TAP_KEY(_FL, KC_CAPS),
};
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t shift_esc_shift_mask;
switch (id) {
case SHIFT_ESC:
shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
if (record->event.pressed) {
if (shift_esc_shift_mask) {
add_key(KC_GRV);
send_keyboard_report();
} else {
add_key(KC_ESC);
send_keyboard_report();
}
} else {
if (shift_esc_shift_mask) {
del_key(KC_GRV);
send_keyboard_report();
} else {
del_key(KC_ESC);
send_keyboard_report();
}
}
break;
case RGBLED_TOGGLE:
//led operations
if (record->event.pressed) {
rgblight_toggle();
}
break;
case RGBLED_INCREASE_HUE:
if (record->event.pressed) {
rgblight_increase_hue();
}
break;
case RGBLED_DECREASE_HUE:
if (record->event.pressed) {
rgblight_decrease_hue();
}
break;
case RGBLED_INCREASE_SAT:
if (record->event.pressed) {
rgblight_increase_sat();
}
break;
case RGBLED_DECREASE_SAT:
if (record->event.pressed) {
rgblight_decrease_sat();
}
break;
case RGBLED_INCREASE_VAL:
if (record->event.pressed) {
rgblight_increase_val();
}
break;
case RGBLED_DECREASE_VAL:
if (record->event.pressed) {
rgblight_decrease_val();
}
break;
case RGBLED_STEP_MODE:
if (record->event.pressed) {
rgblight_step();
}
break;
}
}
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
case 0:
return (record->event.pressed ? MACRO( D(LSFT) ,T(H) , U(LSFT), T(E), T(L), T(L), T(O), END ) :MACRO( END ));
break;
case 1:
return (record->event.pressed ? MACRO(D(LSFT),T(A),T(S),T(D),U(LSFT),T(F),T(G),T(H), END ) :MACRO( END ));
break;
}
return MACRO_NONE;
};
- Laser
- emacs -nw
- Location: Romania
- Main keyboard: Plum TKL \w Topre domes (work) / Novatouch (home)
- DT Pro Member: 0180
I'd just (re)start from the beginning - clone qmk in a new folder, go the satan folder, create a new keymap layout folder based on an existing one, tweak that and the makefile and so on (i.e. re-think it over) ... I have a Satan GH60 and I did that recently (in Arch Linux). I made a HHKB-like layout (to fit with the plate) - but I never had to modify `satan.h` (?)
EDIT: This may help (or not), anyway: workshop-f7/satan-gh60-keymap-configura ... 14700.html
EDIT: This may help (or not), anyway: workshop-f7/satan-gh60-keymap-configura ... 14700.html
Last edited by Laser on 17 Oct 2016, 12:47, edited 1 time in total.
-
- Chasing the Dream
- Location: Berlin
- Main keyboard: redscarf III
- DT Pro Member: -
I will try that, I thought I had to modify it to, but it is long time ago where did something like that, so maybe you're right, I will post results.Laser wrote: ↑I'd just (re)start from the beginning - clone qmk in a new folder, go the satan folder, create a new keymap layout folder based on an existing one, tweak that and the makefile and so on (i.e. re-think it over) ... I have a Satan GH60 and I did that recently (in Arch Linux). I made a HHKB-like layout (to fit with the plate) - but I never had to modify `satan.h` (?)
- Eszett
- Location: Germany
- Main keyboard: Filco Majestouch 2 TKL DE MX blue
- Main mouse: Logitech MX Master 2S
- DT Pro Member: -
Hi! I have a question, how can I get KC_PWR or KC_POWER to take any effect? On my Windows 7 those scancodes do nothing. My PC meets the hardware requirements with ACPI, and ICH9+. With HID_listen I get these reports:
- Attachments
-
- 2.jpg (64.62 KiB) Viewed 10069 times
- Laser
- emacs -nw
- Location: Romania
- Main keyboard: Plum TKL \w Topre domes (work) / Novatouch (home)
- DT Pro Member: 0180
What happens when you press the Power button on your computer (i.e. is Windows configured to actually do something)? KC_PWR should work on Windows, according to https://github.com/tmk/tmk_keyboard/wik ... oesnt-work (but you probably know that already).
- Eszett
- Location: Germany
- Main keyboard: Filco Majestouch 2 TKL DE MX blue
- Main mouse: Logitech MX Master 2S
- DT Pro Member: -
Hi Laser. The physical Powerbutton on my PC shuts my OS (Win7) down. Yes, I've read that FAQ article, and according to HID_listen, KC_POWER does at least send a "keyboard_report", KC_PWR does not. According to the "USB HID usage table", the value "66" is correct: "0x66 Keyboard Power". However, my PC doesn't react to it.
- Laser
- emacs -nw
- Location: Romania
- Main keyboard: Plum TKL \w Topre domes (work) / Novatouch (home)
- DT Pro Member: 0180
What follows is just a supposition: your keyboard may not be allowed to shut down the computer - in the similar way a USB device (mouse, keyboard etc.) has to be allowed to "wake the computer" from sleep. This can be disabled/enabled at two levels, which should be checked (if supposition is true ...): in BIOS, and then at Windows keyboard driver - power management level (e.g. probably like here).
- hasu
- Location: Japan
- Main keyboard: HHKB
- Main mouse: HHKB
- Favorite switch: Topre
- DT Pro Member: -
In addition to what Laser pointed out you have to know KC_PWR is a system control key while KC_POWER is a normal keyboard key. System control keys and media control keys are called as 'extra keys' in TMK.
Unfortunately current tmk_core doesn't spit debug print for the system control keys, to see them on hid_listen apply this patch, you will find output like below. If you don't find it you should build with 'EXTRAKEY_ENABLE'.
Unfortunately current tmk_core doesn't spit debug print for the system control keys, to see them on hid_listen apply this patch, you will find output like below. If you don't find it you should build with 'EXTRAKEY_ENABLE'.
system: 0081
system: 0000
Code: Select all
diff --git a/tmk_core/common/host.c b/tmk_core/common/host.c
index e9b7916..e1fa52d 100644
--- a/tmk_core/common/host.c
+++ b/tmk_core/common/host.c
@@ -54,7 +54,7 @@ void host_keyboard_send(report_keyboard_t *report)
(*driver->send_keyboard)(report);
if (debug_keyboard) {
- dprint("keyboard_report: ");
+ dprint("keyboard: ");
for (uint8_t i = 0; i < KEYBOARD_REPORT_SIZE; i++) {
dprintf("%02X ", report->raw[i]);
}
@@ -75,6 +75,10 @@ void host_system_send(uint16_t report)
if (!driver) return;
(*driver->send_system)(report);
+
+ if (debug_keyboard) {
+ dprintf("system: %04X\n", report);
+ }
}
void host_consumer_send(uint16_t report)
@@ -84,6 +88,10 @@ void host_consumer_send(uint16_t report)
if (!driver) return;
(*driver->send_consumer)(report);
+
+ if (debug_keyboard) {
+ dprintf("consumer: %04X\n", report);
+ }
}
uint16_t host_last_sysytem_report(void)
- Eszett
- Location: Germany
- Main keyboard: Filco Majestouch 2 TKL DE MX blue
- Main mouse: Logitech MX Master 2S
- DT Pro Member: -
Hi Laser. It seems to me that In the properties of "USB Root Hub" or "HID conform Device" (I hope I translated it correctly to it's english naming) I can control if the Compuer may turn off the device to save power, but I can't control if the Devices may shut down the Computer. In BIOS I found indeed a setting, that prevented the keyboard from shutting down the Computer. I changed the setting properly, but unfortunately, the scancodes still don't work
- Eszett
- Location: Germany
- Main keyboard: Filco Majestouch 2 TKL DE MX blue
- Main mouse: Logitech MX Master 2S
- DT Pro Member: -
Hi hasu. I've applied your patch, and indeed, HID listen reports 0081 and 0000 as the "system codes". So far, so good. That means, the scancodes are sent properly, just my system ignores them, right? So it isn't actually a problem of the firmware of the keyboard ...
- hasu
- Location: Japan
- Main keyboard: HHKB
- Main mouse: HHKB
- Favorite switch: Topre
- DT Pro Member: -
Then, it may be worth checking this FAQ entry. Windows can cache device driver setting wrongly and you have to clear it manually in some situations.
https://github.com/tmk/tmk_keyboard/wik ... not-change
https://github.com/tmk/tmk_keyboard/wik ... not-change
- Laser
- emacs -nw
- Location: Romania
- Main keyboard: Plum TKL \w Topre domes (work) / Novatouch (home)
- DT Pro Member: 0180
You'll (probably!) have to change that BIOS setting which, after you boot again/afterwards into Windows, finally allows you to control if the Devices may shut down the Computer, *and* also change that (so, 2 settings, one in BIOS, one in Windows). It may be the BIOS setting you found, or another one, in the lines of "Wake up on ...".Eszett wrote: ↑Hi Laser. It seems to me that In the properties of "USB Root Hub" or "HID conform Device" (I hope I translated it correctly to it's english naming) I can control if the Compuer may turn off the device to save power, but I can't control if the Devices may shut down the Computer. In BIOS I found indeed a setting, that prevented the keyboard from shutting down the Computer. I changed the setting properly, but unfortunately, the scancodes still don't work
-
- Location: Sweden
- DT Pro Member: -
Thanks so much for providing this tutorial. I am reverse engineering the keyboard on an old Minitel device which has 16 pins and have an 8X8 grid where pressing the key closes the connection between row x and col y. I cant really peer inside without breaking the keyboard - I dont think there are any diodes and I think they are simply switches directly wired to the output pins in a matrix which I have solved for. I didnt hook anything up to the led pin and actually i didnt use or alter the led.c file at all nor hook up any leds to any pins which I hope is optional.
I was able to follow all of the instrutions and make the gh60_lufa.hex file and write it to the Teensy 2 ++. At least I think so. The log showed downloading file... compete. But after this nothing happens. I am expecting the keyboard to immediately start working but it doesnt seem to be recognized at all by my mac. Pressing keys does nothing.
Looking forward to any guidance you can give me on this. Im hoping there is some kind of logic missing for this particular kind of direct link keyboard wiring scheme.
Attached are all of my gh60 modified files.
I was able to follow all of the instrutions and make the gh60_lufa.hex file and write it to the Teensy 2 ++. At least I think so. The log showed downloading file... compete. But after this nothing happens. I am expecting the keyboard to immediately start working but it doesnt seem to be recognized at all by my mac. Pressing keys does nothing.
Looking forward to any guidance you can give me on this. Im hoping there is some kind of logic missing for this particular kind of direct link keyboard wiring scheme.
Attached are all of my gh60 modified files.
- Attachments
-
- Archive.zip
- (255.48 KiB) Downloaded 228 times
- dorf
- Location: Sweden
- DT Pro Member: -
Can someone help me?
I'm having trouble getting all keys working as I want them to. PCB is GH60 rev.c from Falbatech
Column 3 and 11 are not working at all. Right shift is not working but FN works as right shift.
Keyboard layout.
keymap_common.h
matrix.c
keymap_poker.c
I'm having trouble getting all keys working as I want them to. PCB is GH60 rev.c from Falbatech
Column 3 and 11 are not working at all. Right shift is not working but FN works as right shift.
Keyboard layout.
keymap_common.h
Code: Select all
#define KEYMAP( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
K40, K41, K42, K45, K4A, K4B, K4C, K4D \
) { \
{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_NO }, \
{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D }, \
{ KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D }, \
{ KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D } \
}
Code: Select all
inline
matrix_row_t matrix_get_row(uint8_t row)
{
return matrix[row];
}
/* Column pin configuration
* col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
* pin: F0 F1 E6 C7 C6 B6 D4 B1 B7 B5 B4 D7 D6 B3 (Rev.C)
*/
static void init_cols(void)
{
// Input with pull-up(DDR:0, PORT:1)
DDRF &= ~(1<<0 | 1<<1);
PORTF |= (1<<0 | 1<<1);
DDRE &= ~(1<<6);
PORTE |= (1<<6);
DDRD &= ~(1<<7 | 1<<6 | 1<<4);
PORTD |= (1<<7 | 1<<6 | 1<<4);
DDRC &= ~(1<<7 | 1<<6);
PORTC |= (1<<7 | 1<<6);
DDRB &= ~(1<<7 | 1<<6 | 1<< 5 | 1<<4 | 1<<3 | 1<<1);
PORTB |= (1<<7 | 1<<6 | 1<< 5 | 1<<4 | 1<<3 | 1<<1);
}
static matrix_row_t read_cols(void)
{
return (PINF&(1<<0) ? 0 : (1<<0)) |
(PINF&(1<<1) ? 0 : (1<<1)) |
(PINE&(1<<6) ? 0 : (1<<2)) |
(PINC&(1<<7) ? 0 : (1<<3)) |
(PINC&(1<<6) ? 0 : (1<<4)) |
(PINB&(1<<6) ? 0 : (1<<5)) |
(PIND&(1<<4) ? 0 : (1<<6)) |
(PINB&(1<<1) ? 0 : (1<<7)) |
(PINB&(1<<7) ? 0 : (1<<8)) | // Rev.C
(PINB&(1<<5) ? 0 : (1<<9)) |
(PINB&(1<<4) ? 0 : (1<<10)) |
(PIND&(1<<7) ? 0 : (1<<11)) |
(PIND&(1<<6) ? 0 : (1<<12)) |
(PINB&(1<<3) ? 0 : (1<<13));
}
Code: Select all
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: qwerty */
KEYMAP(
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, \
CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS, ENT, \
LSFT,NUBS, Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT, FN0,\
LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL),
/* 1: fn layer */
KEYMAP(
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
};
const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1),
};
-
- Location: USA
- Main keyboard: Corsair K70
- Main mouse: Logitech G602
- Favorite switch: Cherry MX Brown
- DT Pro Member: -
I have been trying to compile the firmware for a while not. I can not seem to get it to work no matter what I try. Here is my gh60 file with all the modifications I made to pin out. Could somebody be kind enough to compile it for me?
https://drive.google.com/open?id=0B3a7z ... XByNXItRUE
https://drive.google.com/open?id=0B3a7z ... XByNXItRUE