Thursday, March 26, 2020

00712, the Hand Thing

The Hand Thing is a project I've been obsessing over for a long time.
Editing films and creating motion graphics and animation means working a lot with keyboard shortcuts, you know, cut, paste etc. Most of this work is done with the keyboard and very few time is the keyboard used for typing text (like normal people do).

So this is what they call a Human Interface Device (HID) - something designed to make interactions with a computer easier and/or faster. Here's the end result:



It starts with designing the size and shape of the device with plasticine and placing buttons using ball bearings, so that the buttons fall where the buttons fall where your fingers can easily reach them:


Then it's down to importing the picture into a computer, tracing around the image, making a 3D kinda version of it and cutting the design out of wood using the CNC machine. Once cut, it's on to gluing on buttons and connecting them to a microcontroller (tiny computer), which takes the button presses, converts them into a combination of keyboard commands and sends them down a USB cable to the computer which thinks you're inputting a whole load of keyboard commands:



You could program it to input your name every tine you press a key, or enter passwords and emails automatically. Lots of stuff.

Here's an example fo the code that runs on the microcontroller (called a Teensy LC):


int overlayStatus = 0; // indicates whether to switch to title safe/proportional grid/off

void setup () {
  // initialize the pushbutton pin as an input:
  pinMode(0, INPUT_PULLUP);
  pinMode(1, INPUT_PULLUP);
  pinMode(2, INPUT_PULLUP);
  pinMode(3, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
  pinMode(6, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
  pinMode(13, OUTPUT);

  Keyboard.begin();
}

void loop() {

  /*EASY EASE
    if (digitalRead(0) == LOW) {
    Keyboard.press(KEY_F9);
    do {}
    while (digitalRead(0) == LOW);
    delay (10);
    Keyboard.releaseAll();
    }*/


  //CENTRE ANCHOR POINT AND CENTRE IN VIEWER
  if (digitalRead(0) == LOW) {
    Keyboard.press(KEY_LEFT_ALT);
    Keyboard.press(KEY_LEFT_GUI);
    Keyboard.press(KEY_HOME);
    delay (10);
    Keyboard.releaseAll();
    Keyboard.press(KEY_LEFT_GUI);
    Keyboard.press(KEY_HOME);
    do {}
    while (digitalRead(0) == LOW);
    delay (10);
    Keyboard.releaseAll();
  }

  //TIME REVERSE KEYFRAMES
  if (digitalRead(1) == LOW) {
    Keyboard.press(KEY_LEFT_ALT);
    Keyboard.press('y');
    do {}
    while (digitalRead(1) == LOW);
    delay (10);
    Keyboard.releaseAll();
  }

  //SELECT ALL AND SHOW KEYFRAMES/COLLAPSE
  if (digitalRead(2) == LOW) {
    Keyboard.press(KEY_LEFT_GUI);
    Keyboard.press('a');
    Keyboard.releaseAll();
    delay(10);
    Keyboard.press('u');
    do {}
    while (digitalRead(2) == LOW);
    delay (10);
    Keyboard.releaseAll();
  }

  /*SHOW OR HIDE GRAPH EDITOR
    if (digitalRead(3) == LOW) {
    Keyboard.press(KEY_LEFT_SHIFT);
    Keyboard.press('E');
    do {}
    while (digitalRead(3) == LOW);
    delay (10);
    Keyboard.releaseAll();
    }*/

  //PLAY/stop
  if (digitalRead(3) == LOW) {
    Keyboard.press(32);
    do {}
    while (digitalRead(3) == LOW);
    delay (10);
    Keyboard.releaseAll();
  }

  //ADVANCE 1 FRAME
  if (digitalRead(4) == LOW) {
    Keyboard.press(KEY_PAGE_DOWN);
    delay(150);
    Keyboard.releaseAll();
  }

  //RETREAT 1 FRAME
  if (digitalRead(5) == LOW) {
    Keyboard.press(KEY_PAGE_UP);
    delay(150);
    Keyboard.releaseAll();
  }

  //TITLE SAFE/PROPORTIONAL GRID/NO OVERLAY
  if (digitalRead(6) == LOW) {
    if (overlayStatus == 0) {
      Keyboard.press(KEY_LEFT_ALT);
      Keyboard.press(39);
      overlayStatus = 1;
      do {}
      while (digitalRead(6) == LOW);
      delay (10);
      Keyboard.releaseAll();
    }
    else if (overlayStatus == 1) {
      Keyboard.press(39);
      overlayStatus = 2;
      do {}
      while (digitalRead(6) == LOW);
      delay (10);
      Keyboard.releaseAll();
    }
    else if (overlayStatus == 2) {
      Keyboard.press(39);
      overlayStatus = 0;
      do {}
      while (digitalRead(6) == LOW);
      delay (10);
      Keyboard.releaseAll();
    }
  }

  //RESIZE & REFRAME COMP VIEWER TO FIT
  if (digitalRead(7) == LOW) {
    Keyboard.print('.');
    delay(10);
    Keyboard.press(KEY_LEFT_SHIFT);
    Keyboard.press('/');
    do {}
    while (digitalRead(7) == LOW);
    delay (10);
    Keyboard.releaseAll();
  }


}


No comments:

Post a Comment