- Key key = (grid_button == CHAR_GRID_BUTTON_LEFT ? setup.input[0].key.left :
- grid_button == CHAR_GRID_BUTTON_RIGHT ? setup.input[0].key.right :
- grid_button == CHAR_GRID_BUTTON_UP ? setup.input[0].key.up :
- grid_button == CHAR_GRID_BUTTON_DOWN ? setup.input[0].key.down :
- grid_button == CHAR_GRID_BUTTON_SNAP ? setup.input[0].key.snap :
- grid_button == CHAR_GRID_BUTTON_DROP ? setup.input[0].key.drop :
- KSYM_UNDEFINED);
-#else
- float ypos = 1.0 - 1.0 / 3.0 * video.display_width / video.display_height;
- float event_x = (event->x);
- float event_y = (event->y - ypos) / (1 - ypos);
- Key key = (event_x > 0 && event_x < 1.0 / 6.0 &&
- event_y > 2.0 / 3.0 && event_y < 1 ?
- setup.input[0].key.snap :
- event_x > 1.0 / 6.0 && event_x < 1.0 / 3.0 &&
- event_y > 2.0 / 3.0 && event_y < 1 ?
- setup.input[0].key.drop :
- event_x > 7.0 / 9.0 && event_x < 8.0 / 9.0 &&
- event_y > 0 && event_y < 1.0 / 3.0 ?
- setup.input[0].key.up :
- event_x > 6.0 / 9.0 && event_x < 7.0 / 9.0 &&
- event_y > 1.0 / 3.0 && event_y < 2.0 / 3.0 ?
- setup.input[0].key.left :
- event_x > 8.0 / 9.0 && event_x < 1 &&
- event_y > 1.0 / 3.0 && event_y < 2.0 / 3.0 ?
- setup.input[0].key.right :
- event_x > 7.0 / 9.0 && event_x < 8.0 / 9.0 &&
- event_y > 2.0 / 3.0 && event_y < 1 ?
- setup.input[0].key.down :
- KSYM_UNDEFINED);
-#endif