WhiteFox on TMK

User avatar
matt3o
-[°_°]-

16 Jun 2016, 15:14

Image

Time for a quick tutorial about running TMK firmware on the WhiteFox.

Let me thank Hasu (AGAIN) and flabbergast. I'm just a reporter here, they are the real heroes.

This is just a quick introduction, you'd need to be somewhat familiar with TMK firmware already.

First of all please bear in mind that TMK on WhiteFox is still an experimental project but we need your help testing it. Without a wider user-base we can't fix the bugs.

Setting up the environment

The best way to work with the firmware is from linux. If you are on windows I strongly suggest to install a small linux distro on a virtual machine (virtualbox is free). You don't even need a desktop manager or a GUI, a barebone debian testing would be more than enough. I'm not sure but maybe cygwin might also work.

On a Mac it's easier, but you'd have to install 4Gig or developer tools anyway (X Code), so --unless you already have Xcode installed-- it might be faster/easier to just go with a virtual machine.

Of course you need to install the dev tools, on Debian and Ubuntu I believe they are called "build-essential". You also need to install the cross compiler for ARM Cortex-A/R/M processors. By searching "arm-none-eabi" in your package manager you should be able to find it. On Arch linux I had to install "arm-none-eabi-gcc", "arm-none-eabi-newlib" and "arm-none-eabi-binutils".

Also install "dfu-util" to burn the firmware.

Important: it is always better to flash the firmware from the host OS. So if you are running linux inside a virtual machine, you should flash the firmware from windows (or mac) not directly from inside the virtual machine.

If you insist on using Windows you can download the windows installer here https://launchpad.net/gcc-arm-embedded/+download on a Mac you can compile from source or I'm sure you can find the package on homebrew.

Now get the TMK code from https://github.com/tmk/whitefox . The easiest is to use git

Code: Select all

$ git clone https://github.com/tmk/whitefox.git
$ cd whitefox
$ git submodule update --init --recursive
the last line will take care of sync'ing with both TMK and Chibios repositories. Remember to recheck the code every once in a while because both TMK and Chibios codebases might get updated, and we want updates.

If everything went smooth try to compile the default firmware. just

Code: Select all

$ make
The /build directory should have been created with the compiled firmware.

Try to burn the firmware onto the WhiteFox with dfu-utils. Press the flash button on the bottom of the keyboard and issue the following command (of course you'll need two keyboards connected)

Code: Select all

$ dfu-utils -D build/ch.bin
It is very likely that you'll need to run the above command as super user (so add "sudo " at the beginning of the line).

The keyboard should be working, you don't (shouldn't) need to unplug it.

Customizing the matrix

Layout customization is pretty easy if you are familiar with TMK firmware. Open the keymap_plain.c file with your text editor of choice.

You'll see:

Code: Select all

const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Layer 0: Default Layer
     * ,---------------------------------------------------------------.
     * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  \|  `|Ins|
     * |---------------------------------------------------------------|
     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|Backs|Del|
     * |---------------------------------------------------------------|
     * |CapsLo|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Enter   |PgU|
     * |---------------------------------------------------------------|
     * |Shif|   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift |Up |PgD|
     * |---------------------------------------------------------------|
     * |Ctrl|Gui |Alt |         Space    |Fn0 |Alt |Gui |  |Lef|Dow|Rig|
     * `---------------------------------------------------------------'
     */
    [0] = KEYMAP( \
        ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSLS,GRV, INS, \
        TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSPC,     DEL, \
        CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,NUHS,ENT,      PGUP,\
        LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT,     UP,  PGDN,\
        LCTL,LGUI,LALT,               SPC,           RALT,RGUI,RCTL,     LEFT,DOWN,RGHT \
    ),
};

const uint16_t fn_actions[] = {
};
let's add a momentary layer.

First of all we need to add an FN key. Just for the sake of this tutorial, let's put it in place of RGUI, but you can put it wherever you want.

Code: Select all

...
        LCTL,LGUI,LALT,               SPC,           RALT,FN0,RCTL,     LEFT,DOWN,RGHT \
...
FN0 is the first function key.

Then we add a keymap for the new layer. Something like this should work for now.

Code: Select all

    [0] = KEYMAP( \
        ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSLS,GRV, INS, \
        TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSPC,     DEL, \
        CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,NUHS,ENT,      PGUP,\
        LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT,     UP,  PGDN,\
        LCTL,LGUI,LALT,               SPC,           RALT,RGUI,RCTL,     LEFT,DOWN,RGHT \
    ),
    [1] = KEYMAP( \
        GRV ,F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, TRNS,TRNS,MUTE,\
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,TRNS,TRNS,TRNS,     TRNS,\
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PENT,     VOLD,\
        TRNS,TRNS,FN1 ,FN2 ,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     PGUP,VOLU,\
        TRNS,TRNS,TRNS,               TRNS,          TRNS,TRNS,TRNS,     HOME,PGDN,END  \
    ),
TRNS, means transparent, basically the key will take the value of the layer underneath. I've also added a FN1 and FN2, we will need them later.

Finally we need to add an action to the layer, it is a momentary layer so all we have to do is add ACTION_LAYER_MOMENTARY action to the fn_actions array.

Code: Select all

const uint16_t fn_actions[] = {
    [0] = ACTION_LAYER_MOMENTARY(1),
};
[0] is the FN0 key, (1) is the keymap or layer that will be activated. Easy peasy.

Now save and compile it again. Burn and enjoy your first layer.

As you can see it's same old TMK thing. Get used to it and proceed to the next chapter.

Backlight

This is where things get complicated. Follow me closely.

The WhiteFox is able to light each LED separately. Super cool. You can light any number of them at any brightness you desire. This is relatively easy when you want to toggle a single LED but it gets a bit complicated if you need more sophisticated setups.

But let's start from the single LED.

FIrst of all include the "led_controller.h" header file at the top of the file

Code: Select all

#include "keymap_common.h"

#include "led_controller.h"

#define ACTION_LEDS_ENTER 2
..
This gives us access to the backlight. we also added a constant that we are going to use later.

Now we are telling the controller to light the ENTER LED when FN1 is pressed.

Add the FN1 action to the fn_actions array:

Code: Select all

const uint16_t fn_actions[] = {
    [0] = ACTION_LAYER_MOMENTARY(1),
    [1] = ACTION_FUNCTION(ACTION_LEDS_ENTER),
};
we defined a function key that will trigger a custom function. At the end of the file add:

Code: Select all


void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
  (void)opt;
  switch(id) {
    case ACTION_LEDS_ENTER:
      // toggle enter LED on press
      if(record->event.pressed) {
        // signal the LED controller thread
        chMBPost(&led_mailbox, LED_MSG_ENTER_TOGGLE, TIME_IMMEDIATE);
      }
      break;
  }
}
This is actually all you have to do. Compile and flash. Test if everything's working and come back here for an explanation.

Open the led_controller.c file and search for "0x78". That would be the address of the LED under the enter key. The address matrix is as follow:

Code: Select all

  11 12 13 14 15 16 17 18 21 22 23 24 25 26 27  28
   31 32 33 34 35 36 37 38 41 42 43 44 45  46   47
   48 51 52 53 54 55 56 57 58 61 62 63 64   65  66
    67 68 71 72 73 74 75 76 77 78 81 82  83  84 85
  86  87  88       91        92  93 (94)  95 96 97
to find the right hexadecimal value do as follow:

Code: Select all

the Enter key is 65 where A = 6 and B = 5.

0x24 + (A-1)*0x10 + (B-1)

therefore

0x24 + (6-1)*0x10 + (5-1) = 0x78

so 0x78 is the enter led
In bash the easiest way I could find to obtain the LED address is with the following command

Code: Select all

printf '%x\n' $((0x24 + (6-1)*0x10 + (5-1)))
I'm no bash guru, I'm sure there's a better way, if you know it just let me know.

Let's have a quick look at the incriminating code.

Code: Select all

      case LED_MSG_ENTER_TOGGLE:
        is31_read_register(0, 0x78, &temp);
        chThdSleepMilliseconds(1);
        if(temp) {
          // turn off on pages 1 and 2
          is31_write_register(0, 0x78, 0);
          is31_write_register(1, 0x78, 0);
        } else {
          // turn on on pages 1 and 2
          is31_write_register(0, 0x78, 0xFF);
          is31_write_register(1, 0x78, 0xFF);
        }
        break;
we have a temp variable that holds the LED status. All we do is checking the "temp" variable, if the LED needs to be turned on we write "0xFF" to the LED address "0x78" (0xFF being the LED brightness). To turn it off we just set the brightness to "0".

Now. Why are we doing this twice (for page 1 and 2)? Very good question, thanks for asking.

Backlight pages

As far as I understand communication between the main controller and the LED controller is quite slow, so we have to initialize the backlight on the init phase. To do so we have save an "image" of the backlight setup in one of the 8 available pages.

Say you want to light up WASD and the arrow cluster as shown the picture above, you do so by creating a picture of the LED you want lighted up with the brightness you want. Think of the keyboard backlight as a very low resolution monitor. Each LED is a pixel, each pixel may have 256 levels of brightness.

At startup we store the image we want to draw on the keyboard LED matrix in one of the available pages. We will be later able to switch from one page to another (with a nice fade out/in effect).

There are certain LEDs though that need to keep their state no matter what page we are showing. Think of the CAPS LOCK for example, or the ENTER LED we did earlier. The state of those keys must be remembered no matter what page we are in. That is the reason why we are writing the state of the ENTER LED two times. The first time on page 0 the second time on page 1. Currently we have nothing on "page 1" (we haven't set any effect for it yet), but if we had 3 images (eg: full off, full on and WASD) we would have to print the ENTER LED value on all three of our pages.

Hope it all makes sense. It took a while to get used to it but it will be easier to understand with some examples.

For now try to absorb what we've discussed so far, the next time I'll show you how to design a backlight image. If you want to get a glimpse of it you could have a look at the kyemap_flabber.c and the led_controller.c files.

The image for WASD+ESC+Arrows is

Code: Select all

const uint8_t led_game[83] = {
  0x24,
  0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x34,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x44,
  0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x54,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x64,
  0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x74,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x84,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x94,
  0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00,
  0xA4,
  0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00,
};
As I said next time I'll try to tell you everything there's to know about it.

User avatar
HzFaq

16 Jun 2016, 16:12

My hero, I'll try it tonight with a bit of luck and report back.

User avatar
scottc

16 Jun 2016, 16:50

Aww yes. Matt3o, you are the man. I can't wait to try this tonight!

Don't get me wrong, the web configurator is seriously cool, but this way I can keep my layouts in source control and synced across computers. Thank you matt3o!

User avatar
scottc

17 Jun 2016, 01:02

matt3o wrote: Try to burn the firmware onto the WhiteFox with dfu-utils. Press the flash button on the bottom of the keyboard and issue the following command (of course you'll need two keyboards connected)
Pfft! If you're hardcore you don't need two keyboards, you just have to know your code is correct and type:

Code: Select all

sleep 10 && dfu-util -D build/ch.bin
;)

Thanks a lot for the guide. Typed from my newly-TMK'd Whitefox! I was able to follow along and create a new LED setup where I can toggle everything on/off with FN0 + right ctrl. Very nice.

It was very odd, the default enter toggle backlight code makes my G key LED illuminated as well as enter. I wonder if I've got dodgy wiring, but it seems absurd since they're so far away...

I've got some Ubuntu/Debian-specific tips for anyone who's stuck:

Packages are: binutils-arm-none-eabi, gcc-arm-none-eabi dfu-util.
Command line is dfu-util, not dfu-utils with an 's'. Must be different on your distro matt3o!

I'll clean up my code and post it over the weekend (hopefully). :)

Thanks again matt3o, this was an awesome guide!

One minor thing: it seems like TMK takes a few seconds to start registering keypresses after it's plugged in. Is that expected? It's not a big deal, it's just noticeably slower than the default firmware.

User avatar
matt3o
-[°_°]-

17 Jun 2016, 08:15

scottc wrote: It was very odd, the default enter toggle backlight code makes my G key LED illuminated as well as enter. I wonder if I've got dodgy wiring, but it seems absurd since they're so far away...
that is not completely absurd. Led matrix is pretty chaotic (and incredibly difficult to debug).
scottc wrote: Command line is dfu-util, not dfu-utils with an 's'. Must be different on your distro matt3o!
no, that would be an error on my part. corrected.
scottc wrote: One minor thing: it seems like TMK takes a few seconds to start registering keypresses after it's plugged in. Is that expected? It's not a big deal, it's just noticeably slower than the default firmware.
I haven't noticed before, but you are right. It takes 2-3 seconds to "boot". Could it be the registering of the backlight pages? I hope flabbergast or Hasu could chime in.

User avatar
flabbergast

17 Jun 2016, 08:56

Boot delay: There is a 1.5second wait in the USB init function. The order of things is: disconnect USB BUS (release the pullup on D+ line), wait 1.5 seconds, connect USB BUS (enable the pullup on D+ line). This code is my entirely my "fault"; it is there for the case when the code is run after a reset (not powerup) - then the MCU needs to get a "clean start" as far as USB is concerned and distance itself from any previous enumeration on the host. {This of course never happens on WhiteFox because a reset triggers the bootloader.}
You're right that this could be improved (i.e. do not wait on powering up). For those that want to get rid of this manually, the code is in tmk_core/protocol/chibios/usb_main.c, in init_usb_driver() function. I'll think about how to do this properly (this is code that's supposed to run on other ARM MCUs as well).

BTW the communication with the LED controller chip is not that terribly slow: the communication itself runs at 400kHz, which translates to roughly 43kB/sec. The point is that the LED controller chip also needs to react and do its own thing - so for instance when it's told do fade out/fade in, it will be busy doing that until it's done and may not respond correctly to any new communication.

User avatar
HzFaq

17 Jun 2016, 15:41

Thanks for the tips guys, I got as far as getting a Debian VM set up and then had to get an early night for an interview so I'll probably try and get it finished this weekend. Of course, I still need to finish building the board first...

User avatar
HzFaq

23 Jun 2016, 09:43

Typing this out on my new TMK Whitefox :D. Another thanks needed for matt3o for giving me the kick up the arse needed to finally get on Linux, so much easier compiling there than on Windows.

Thanks so much for the guide lads, just a little input from me about flashing firmware on Windows as I couldn't flash from the VM or get the gui to work (using this guide) I had to use the below command line from inside the kii-dfu folder.

dfu-util.exe -D C:\path-to-file\ch.bin

Just need to make some minor tweaks (I disabled the wrong part of the split backspace key) but should be fully up and running by the weekend :D.

Oh, and I changed the colour scheme

Image

User avatar
matt3o
-[°_°]-

23 Jun 2016, 13:13

congrats for your build!

and I love your controller! where would you get one?

User avatar
Wodan
ISO Advocate

23 Jun 2016, 14:10

http://www.8bitdo.com/nes30pro/

WARNING: no native iOS support!

User avatar
HzFaq

23 Jun 2016, 15:43

Yup, I wanted something that I could use to play emulators on my tablet at work. I like it, is a little thin but the sticks and buttons are pretty good and you can pick them up on eBay for about £20.

User avatar
matt3o
-[°_°]-

23 Jun 2016, 16:46

oh is it intended for mobile devices? and no linux support?! crap!

User avatar
cookie

23 Jun 2016, 18:34

Wodan wrote: WARNING: no native iOS support!
Probably the best thing of all!

User avatar
beltet

26 Jun 2016, 20:38

matt3o wrote: oh is it intended for mobile devices? and no linux support?! crap!
It is intended for mobile devices but I don't think it would be any problems with linux. It acts as a generic bluetooth controller or generic controller with the cable plugged. Works flawless on android. I have the NES30 and SFC30 controller myself.

xtracted

10 Jul 2016, 14:53

Are there any keycodes for ISO layouts? I want to make a german layout but I can't find the corresponding keycodes anywhere.
Is there a way to use simple keycodes for that or do I have to use Alt codes or send Unicode characters?

User avatar
HzFaq

10 Jul 2016, 15:26

Nubs/nuhs are the two ISO specific keys, I can't remember which one is which though...I can post an example of my ISO keymap a bit later on if you want to use that as a base for yours.

xtracted

10 Jul 2016, 16:56

Ok thanks.
Yes that would be great if you could post your keymap.

User avatar
HzFaq

10 Jul 2016, 19:24

Keymap_common
Spoiler:

Code: Select all

/*
Copyright 2015 Jun Wako <wakojun@gmail.com>

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/>.
*/
#ifndef KEYMAP_COMMON_H
#define KEYMAP_COMMON_H

#include <stdint.h>
#include <stdbool.h>
#include "keycode.h"
#include "action.h"
#include "action_macro.h"
#include "action_util.h"
#include "report.h"
#include "host.h"
#include "print.h"
#include "debug.h"
#include "keymap.h"


extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[];


/* WhiteFox 
 * ,---------------------------------------------------------------.
 * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backspc|Ins|
 * |---------------------------------------------------------------|
 * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|     |Del|
 * |------------------------------------------------------Enter----|
 * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  #|    |PgU|
 * |---------------------------------------------------------------|
 * |Shif|   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift |Up |PgD|
 * |---------------------------------------------------------------|
 * |Ctrl|Gui |Alt |         Space    |App |Alt |Gui |  |Lef|Dow|Rig|
 * `---------------------------------------------------------------'
 */

#define KEYMAP( \
    K00, K10, K20, K30, K40, K50, K60, K70, K80, K01, K11, K21, K31, K51,      K61, \
    K71, K81, K02, K12, K22, K32, K42, K52, K62, K72, K82, K03, K13,           K33, \
    K43, K53, K63, K73, K83, K04, K14, K24, K34, K44, K54, K64, K74, K84,      K05, \
    K15, K25, K35, K45, K55, K65, K75, K85, K06, K16, K26, K36, K46,      K56, K66, \
    K76, K86, K07,                K17,           K27, K37, K47,      K57, K67, K77  \
) { \
    { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
    { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \
    { KC_##K20, KC_##K21, KC_##K22, KC_NO   , KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \
    { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \
    { KC_##K40, KC_NO   , KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \
    { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \
    { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \
    { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \
    { KC_##K80, KC_##K81, KC_##K82, KC_##K83, KC_##K84, KC_##K85, KC_##K86, KC_NO    }  \
}

#endif
Keymap plain
Spoiler:

Code: Select all

/*
Copyright 2015 Jun Wako <wakojun@gmail.com>

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 "keymap_common.h"

const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Layer 0: Default Layer
     * ,---------------------------------------------------------------.
     * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backspc|Ins|
     * |---------------------------------------------------------------|
     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|     |Del|
     * |------------------------------------------------------Enter----|
     * |CapsLo|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  #|    |PgU|
     * |---------------------------------------------------------------|
     * |Shif|  \|  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift |Up |PgD|
     * |---------------------------------------------------------------|
     * |Ctrl|Gui |Alt |         Space    |Fn0 |Alt |Gui |  |Lef|Dow|Rig|
     * `---------------------------------------------------------------'
     */
    [0] = KEYMAP(  
        FN8 ,1   ,2   ,3   ,4   ,5   ,6   ,7   ,8   ,9   ,0   ,MINS,EQL ,BSPC,    GRV ,\
        TAB ,Q   ,W   ,E   ,R   ,T   ,Y   ,U   ,I   ,O   ,P   ,LBRC,RBRC,          DEL,\
        LCTL,A   ,S   ,D   ,F   ,G   ,H   ,J   ,K   ,L   ,FN3 ,QUOT,NUHS,ENT ,    PGUP,\
        LSFT,FN2 ,Z   ,X   ,C   ,V   ,B   ,N   ,M   ,COMM,DOT ,SLSH,RSFT,     UP, PGDN,\
        FN1 ,LGUI,LALT,               SPC,           RALT,RGUI,FN1 ,    LEFT,DOWN,RGHT  ),
    [1] = KEYMAP(  
        FN8 ,F1  ,F2  ,F3  ,F4  ,F5  ,F6  ,F7  ,F8  ,F9  ,F10 ,F11 ,F12 ,BSPC,    CAPS,\
        TAB ,DEL ,TRNS,UP  ,PSCR,BRK ,TRNS,PSCR,UP  ,TRNS,DEL ,TRNS,TRNS,          INS,\
        LCTL,TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,LEFT,DOWN,RGHT,FN3 ,INS ,SLCK,ENT ,    HOME,\
        LSFT,FN2 ,HOME,PGUP,PGDN,END ,TRNS,TRNS,HOME,PGUP,PGDN,END ,RSFT,     UP,  END,\
        FN1 ,LGUI,LALT,              BSPC,           RALT,RGUI,FN1 ,    LEFT,DOWN,RGHT  ),
    [2] = KEYMAP(  
        FN8 ,F1  ,F2  ,F3  ,F4  ,F5  ,F6  ,F7  ,F8  ,F9  ,F10 ,F11 ,F12 ,BSPC,    NLCK ,\
        TAB ,DEL ,PMNS,PPLS,PAST,PSLS,TRNS,P7  ,P8  ,P9  ,PSLS,TRNS,TRNS,          DEL,\
        LCTL,EQL ,DEL ,PENT,TAB ,FN6 ,TRNS,P4  ,P5  ,P6  ,FN3 ,TRNS,NLCK,TRNS,    PGUP,\
        LSFT,FN2 ,TRNS,TRNS,TRNS,FN7 ,PDOT,P0  ,P1  ,P2  ,P3  ,PDOT,RSFT,     UP, PGDN,\
        FN1 ,LGUI,LALT,              BSPC,           RALT,RGUI,FN1 ,    LEFT,DOWN,RGHT  ),
    [3] = KEYMAP(  
        FN8 ,F1  ,F2  ,F3  ,F4  ,F5  ,F6  ,F7  ,F8  ,F9  ,F10 ,F11 ,F12 ,BSPC,    GRV ,\
        TAB ,TRNS,BTN4,WH_U,BTN5,TRNS,TRNS,TRNS,MS_U,TRNS,TRNS,TRNS,TRNS,          DEL,\
        LCTL,TRNS,BTN2,BTN3,BTN1,TRNS,TRNS,MS_L,MS_D,MS_R,FN3 ,TRNS,TRNS,TRNS,    PGUP,\
        LSFT,FN2 ,TRNS,TRNS,WH_D,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,RSFT,     UP, PGDN,\
        FN1 ,LGUI,LALT,               SPC,           RALT,RGUI,FN1 ,    LEFT,DOWN,RGHT  ),
    [4] = KEYMAP(  
        FN8 , NO , NO , NO , NO , NO , NO , NO , NO , NO , NO ,VOLD,VOLU,PWR ,     NO ,\
         NO , NO , NO , NO , NO , NO , NO , NO , NO , NO ,MPLY,MPRV,MNXT,          NO ,\
         NO , NO , NO , NO , NO , NO , NO , NO , NO , NO , NO , NO , NO,  NO ,     NO ,\
         NO , NO , NO , NO , NO , NO , NO , NO , NO , NO , NO , NO , NO ,     NO,  NO ,\
         NO , NO , NO ,                NO,            NO , NO , NO ,     NO , NO , NO   ),

};

const uint16_t fn_actions[] = {
    [1] = ACTION_LAYER_MOMENTARY(1),
    [2] = ACTION_LAYER_TAP_KEY(2, KC_NUBS),
    [3] = ACTION_LAYER_TAP_KEY(3, KC_SCLN),
    [4] = ACTION_MODS_ONESHOT(MOD_LSFT),
    [5] = ACTION_MODS_ONESHOT(MOD_RSFT),
    [6] = ACTION_MODS_KEY(MOD_LSFT, KC_SCLN),
    [7] = ACTION_MODS_KEY(MOD_LSFT, KC_TAB),
    [8] = ACTION_LAYER_TAP_KEY(4, KC_ESC),
};
Hope that helps. Obviously, that's got my custom layers and keymap but it'll get you started.

User avatar
matt3o
-[°_°]-

11 Jul 2016, 13:12

I've pushed some updates to the backlight. I don't know if hasu will merge them but If you have LEDs you should definitely check this version https://github.com/cubiq/whitefox

xtracted

11 Jul 2016, 17:40

HzFaq wrote: Hope that helps. Obviously, that's got my custom layers and keymap but it'll get you started.
Thanks a lot and thanks matt3o. Can't wait to flash my WhiteFox. It should arrive tomorrow :D

User avatar
HzFaq

11 Jul 2016, 17:51

No worries, don't forget to post pics when you're done :D.

xtracted

12 Jul 2016, 20:16

My keyboard finally arrived today. TMK is already flashed.
Thank you for the great design Matt3o :D
Everything else is perfect except that i didn't get the Prima printing on the back :/

User avatar
matt3o
-[°_°]-

12 Jul 2016, 20:30

I'll be posting some updates to the firmware in the coming days. Stay tuned!
xtracted wrote: Everything else is perfect except that i didn't get the Prima printing on the back :/
Only the first 1000 got that.

xtracted

12 Jul 2016, 20:40

Already starred your fork on github ;)
I got the batch one certificate and I am batch one according to MD ;)
But that's definitely not enough of an issue for me to send the keyboard from Austria back to the US

User avatar
matt3o
-[°_°]-

12 Jul 2016, 20:52

all 1300 orders are "batch one", of which the first 1000 are "prima". but it is very likely that MD screwed it up.

xtracted

13 Jul 2016, 08:44

Oh ok I thought batch one = prima.
Nontheless an outstanding keyboard.

User avatar
Wodan
ISO Advocate

13 Jul 2016, 09:09

Well the confusion is definitly Massdrops fault ;)

After all they called the first 1000 units "Batch one" and the remaining units "Batch two"

So basically all Massdrop BATCH ONE orders are PRIMA and all orders from the first drop are Matt3o's definition of Batch One.

User avatar
kristofv
8088

13 Jul 2016, 16:53

received my whitefox! I'd also want to link https://github.com/tmk/tmk_core/blob/ma ... /keymap.md here, since it really helped a lot with adding macros and tap actions etc. Thanks to matt3o, flabbergast and hasu! It's an awesome experience.

xtracted

16 Jul 2016, 20:08

At least the keyboard itself is totally fine and working great.

Can someone try out if this works?

Code: Select all

ACTION_LAYER_TAP_KEY(1, KC_RGUI)
I can't seem to get it to work but I don't know why...

User avatar
TheNacho
delicious.

17 Jul 2016, 19:03

Hi, I received my WhiteFox this week, and I am having some problems with key chattering while typing, resulting in having some letters doubleed or tripled in the texttt that I am writing.

Is there anything I can check for? Unfortunately it happens on too many switches to change them out, since I onnly have two spares (one of the switches was completely broken already)

Thanks!

Post Reply

Return to “Workshop”