           buf[0] = buf[0] & UNSHIFT;
         }
       } else {
-        uint8_t t = array[buf[i]-start];
+        uint16_t t = array[buf[i]-start];
         buf[i] = purify(t);
         if(isGrr(t)) {
           buf[0] = buf[0] | GRR;

#include <usbhub.h>
#include <LiquidCrystal.h>

#define FORCE_SHIFT 0x80
#define FORCE_ALTGR 0x40
#define PURIFY 0x3F
#define LETTERS_START 0x04
#define LETTERS_END 0x1D
#define LETTERS_CNT 26

#define UNGRR 0xBF


uint16_t invShift(uint16_t v) {
  return v + FORCE_SHIFT;
}
uint16_t grr(uint16_t v){
  return v + FORCE_ALTGR;
}

boolean isShifted(uint16_t v){
  return (v & FORCE_SHIFT);
}

boolean isGrr(uint16_t v){
  return (v & FORCE_ALTGR);
}

