Fighting Games on a Keyboard?

Hello, this is Nine, the owner of Yushakobo.

 

PC Watch published this blog entry recently:

pc.watch.impress.co.jp

 

It is about Mr. Kawano, a Japanese professional gamer that wants to take on Street Fighter V with a keyboard.

The editors at PC Watch contacted us and told us that Mr. Kawano will be participating in a Street Fighter V tournament, so we helped him with keyboard firmware customization, which we will talk about in detail below.

 

About Customizing Firmware

DIY keyboards often run on  QMK Firmware, an open-source keyboard firmware. Pretty much all the keyboard kits we sell run on QMK.

github.com

 

DZ60 REV 3.0 type-C, the keyboard that Mr. Kawano chose, also runs on QMK.

We modified the following code to add a special action for him.

(Normally we do not offer firmware modification service, but this was an interesting occasion, so we worked with PC Watch and Mr. Kawano.)

 

Cancelling Action by Pressing Two Keys

We added the following code segments to the keymap:

```
static bool A_pressed = false;
static bool D_pressed = false;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
 switch (keycode) {
  case KC_A:
    if (record->event.pressed) {
      A_pressed = true;
      if(D_pressed){
        unregister_code(KC_D);
        return false;
    }
  }else{
    A_pressed = false;
    if(D_pressed){
      register_code(KC_D);
    }
  }
 break;
 case KC_D:
   if (record->event.pressed) {
     D_pressed = true;
     if(A_pressed){
       unregister_code(KC_A);
       return false;
     }
   }else{
     D_pressed = false;
     if(A_pressed){
       register_code(KC_A);
     }
   }
 break;

}
return true;
}
```

 

Character movements are controlled by WASD, of which A and D are mapped to left and right respectively. The code segment cancels one pressed key when the other key is pressed.

First, when either A or D is pressed, the static variable A_pressed / D_pressed is set to true, so that it remains in the pressed state to the system. If the opposite direction is currently pressed, both actions are cancelled. When letting go of one key, if the other one is pressed, then the other key is registered.

The fact that a few simple lines of code can do so much is why DIY keyboard is fun.

The keymap can be found below:

github.com

 

The layout of the keyboard is as follows:

f:id:yushadul:20200401153611p:plain



 

Equipment

Mr. Kawano's keyboard components are as follows:

DZ60 REV 3.0 type-c 

A 60% keyboard PCB with USB Type-C

 

60% Plastic Case

A must-have for the RGB lighting on DZ60 to shine through

 

DZ60% CNC Plate (Aluminum)

Type-B

 

MX Switch Stabilizer

1 set of 2Ux4 + 6.25U x1

 

Kailh Speed Switch (10pcs)

63 Silver switches

 

Floating 104-key Keycaps, English

White

 

And Finally

After reading the entry, it seems like Mr. Kawano did not need the modified firmware after all, but it was fun for us to learn about his field!

 

Yushakobo, a DIY keyboard shop that even caters to professional gamer

https://yushakobo.jp