Close

Completed programming

A project log for Mechanical GKOS keyboard for phones and tablets.

A no-compromise, mechanical switch, 6-button chording keyboard, placed on the rear side of a tablet or a mobile phone.

ptravptrav 05/17/2018 at 04:280 Comments

The keyboard software is based on the quick-and-dirty GKOS keyboard I have tested earlier.

The major difference presently is the absence of a mouse/joystick - on an Android phone, I found the mouse pointer pretty useless anyway (this is rather a pun to the Android team, who gave the mouse functionality such a low development priority). The mouse can be added later if I decide on an Raspberry Pi build.


The keyboard operates in 5 modes:

0 - normal (small letters)

1 - single capital letter, then switches back to mode 0. This mode is activated by the left Shifter press and indicated by the left LED.

2 - all capital letters. This mode is activated by the left Shifter double press and deactivated by the left Shifter. Left LED is lit (Probably will make it blink in the future).

3 - single symbol / number , then switches back to mode 0. This mode is activated by the right Shifter press. Right LED is lit.

4 - number mode. This mode is activated by the double right Shifter press. Both LEDs are lit. To cancel the mode back to 0, press any Shifter.

Additionally, the keyboard handles Russian alphabet, simulating the de-facto standard JCUKEN layout, so Android does not need to deal with any special phonetic keyboards.  Arduino remembers if the current national layout has been activated and if the user moves to the "number" mode switches back to English. This way, the  Russian "e" will not end up in the exponential numbers and such. After the number mode is deactivated, the national symbol mode is automatically restored.

The only additional (and optional) software on the mobile phone is the NULL Keyboard from wParam, available free on Playstore:

https://play.google.com/store/apps/details?id=com.wparam.nullkeyboard&hl=en_AU

It prevents the telephone on-screen keyboard popping up if one switches between input fields.

The current mode is implemented as following:

  bool modebutton = ReadPinBool( 7);
  if( modebutton && !GKOS_prevRight)
  {
    GKOS_prevRight = true;
    switch (GKOS_mode)
    {
      case 3:
        GKOS_mode = 4;
        #ifdef _DEBUG
        Serial.println( "Mode set to NUM");
        #endif
        break;
      case 4:
        GKOS_mode = 0;
        ForceRusLat( GKOS_prevRussian);
        #ifdef _DEBUG
        Serial.println( "Mode set to NORMAL");
        #endif
        break;
      default:
        GKOS_mode = 3;
        GKOS_prevRussian = GKOS_Russian; 
        ForceRusLat( false);
        #ifdef _DEBUG
        Serial.println( "Mode set to SYMBOL");
        #endif
        break;
    }
    SetLEDs();
  }  
  if( !modebutton && GKOS_prevRight) GKOS_prevRight = false;
  modebutton = ReadPinBool( 6);
  if( modebutton && !GKOS_prevLeft)
  {
    GKOS_prevLeft = true;
    switch (GKOS_mode)
    {
      case 0:
        GKOS_mode = 1;
        #ifdef _DEBUG
        Serial.println( "Mode set to SHIFT");
        #endif
        break;
      case 1:
        GKOS_mode = 2;
        #ifdef _DEBUG
        Serial.println( "Mode set to CAPS");
        #endif
        break;
      case 3:
        GKOS_mode = 4;
        #ifdef _DEBUG
        Serial.println( "Mode set to NUM");
        #endif
        break;
      case 4:
        GKOS_mode = 0;
        ForceRusLat( GKOS_prevRussian);
        #ifdef _DEBUG
        Serial.println( "Mode set to NORMAL");
        #endif
        break;
      default:
        GKOS_mode = 0;
        #ifdef _DEBUG
        Serial.println( "Mode set to NORMAL");
        #endif
        break;
    }
    SetLEDs();
  }  
  if( !modebutton && GKOS_prevLeft) GKOS_prevLeft = false;

 The whole sketch is in the project files. If somebody is interested, I can make an English-only version.

Discussions