   }
 
   /* Pressing and holding down on a sketch icon? Edit then. */
-  if (touchedIndex < IDX_MENU_START && ((millis() - pressed_time_start) > HOLD_ACTIVATE_DELAY)) {
+  if (touchedIndex != MENU_IDX_NONE && touchedIndex >= MENU_IDX_SKET && ((millis() - pressed_time_start) > HOLD_ACTIVATE_DELAY)) {
     editSketch(sketch_icon_text[touchedIndex], false);
     reloadAll = true;
   }
   
   /* Released a button? Handle logic for the button released. */
-  if (touchedIndex == IDX_NONE && oldTouchedIndex != IDX_NONE && !LCD_isTouchedAny()) {
+  if (touchedIndex == MENU_IDX_NONE && oldTouchedIndex != MENU_IDX_NONE && !LCD_isTouchedAny()) {
     
-    if (oldTouchedIndex == IDX_UP) {
+    if (oldTouchedIndex == MENU_IDX_UP) {
       /* Move sketch list one page up, ignore if impossible */
       if (sketch_offset) {
         sketch_offset -=  SKETCHES_PGINCR;
         redrawIcons = true;
       }
-    } else if (oldTouchedIndex == IDX_DOWN) {
+    } else if (oldTouchedIndex == MENU_IDX_DOWN) {
       /* Move sketch list one page down, ignore if impossible */
       if ((sketch_offset + SKETCHES_PGINCR) < sketches_buff_cnt) {
         sketch_offset += SKETCHES_PGINCR;
         redrawIcons = true;
       }
-    } else if (oldTouchedIndex == IDX_ADD) {
+    } else if (oldTouchedIndex == MENU_IDX_ADD) {
       /* Ask for the new file name, if successful, edit the icon */
       char name[9];
       memset(name, ' ' , 8);

#define MENU_OFF_X   (PHNDisplayHW::WIDTH-MENU_ICON_W)
#define MENU_OFF_Y   5

/* Edit dialog settings */
#define EDIT_ICON_SCALE     3
#define EDIT_ICON_W         (EDIT_ICON_SCALE * SKETCHES_ICON_W)

  /* Clear the sketch icon area and redraw all icons */
  if (redrawIcons) {
    redrawIcons = false;
    PHNDisplay8Bit::fillRect(SKETCHES_OFF_X, SKETCHES_OFF_Y, SKETCHES_FULLW, SKETCHES_FULLH, COLOR_MENU_BG);
    memset(sketch_icon_dirty, 1, sizeof(sketch_icon_dirty));
  }

