static void clickButton(int b)
{
    if (!blackout)
    {
        if (menu)
        {
            change_set(b, false);
            return;
        }
        
        if (size > 3)
        {
            size /= 3;
            if (b == TOP)
            end -= 2*size;
            else if (b == MID)
            {
                top += size;
                end -= size;
            }
            else if (b == BOT)
            top += 2*size;
        }
        else
        {
            text_buffer[pos++] = master[top+b];
            text_layer_set_text(wordsYouWrite, text_buffer);
            change_set(cur_set, false);
            next();
        }
        
        drawSides();
    }
    
}
static void down_long_click_handler(ClickRecognizerRef recognizer, void* context) {

    if (common_long(BOT)) return;

    // delete or cancel when back is held
    if (size==27 && pos>0 )
    {
        text_buffer[--pos] = ' ';
        drawNotepadText();
    }
    else
    {
        next();
        drawSides();
    }

}
static void down_long_click_handler(ClickRecognizerRef recognizer, void* context) {
    
    if (common_long(BOT)) return;
    
    // delete or cancel when back is held
    
    if (size==27 && pos>0 && !blackout)
    {
        text_buffer[--pos] = ' ';
        text_layer_set_text(wordsYouWrite, text_buffer);
    }
    else
    {
        next();
        drawSides();
    }
    
}
// This function changes the next case/symbol set.
static void change_set(int s, bool lock)
{
    int count = 0;
    master = rotate_text[s];
    for (int i=0; i<3; i++)
    {
        for (int j=0; j<3; j++)
        {
            for (int k=0; k<3; k++)
            {
                btexts[i][j][k] = master[count];
                count++;
            }
        }
    }
    
    menu = false;
    if (lock) cur_set = s;
    
    drawSides();
}
示例#5
0
static void clickButton(int b)
{
  if (!blackout)
  {
    if (menu)
    {
      change_set(b, false);
      return;
    }
    
    if (size > 3)
    {
      size /= 3;
      if (b == TOP)
      end -= 2*size;
      else if (b == MID)
      {
        top += size;
        end -= size;
      }
      else if (b == BOT)
      top += 2*size;
    }
    else
    {
      text_buffer[pos++] = master[top+b];
      if(pos==DESCRIPTION_LENGTH)
        --pos;
      drawNotepadText();
      change_set(cur_set, false);
      next();
    }
    
    drawSides();
  }
  refresh_timeout();
}
static void clickButton(int b)
{
    if (menu)
    {
        change_set(b, false);
        return;
    }

    if (size > 3)
    {
        size /= 3;
        if (b == TOP)
            end -= 2*size;
        else if (b == MID)
        {
            top += size;
            end -= size;
        }
        else if (b == BOT)
            top += 2*size;
    }
    else
    {
        // Prevent overflowing
        if (pos == MAX_CHARS-1)
            pos--;

        // Type the character
        text_buffer[pos++] = master[top+b];
        drawNotepadText();
        change_set(cur_set, false);
        next();
    }

    drawSides();
}