User Event Android

import android.view.KeyEvent;
 class KeyUtils {
  private KeyUtils() {}
  
  public static int intrepretDirection(int code) {
    switch(code) {
    case KeyEvent.KEYCODE_LEFT_BRACKET:
    case KeyEvent.KEYCODE_DPAD_LEFT:
    case KeyEvent.KEYCODE_1:
    case KeyEvent.KEYCODE_4:
    case KeyEvent.KEYCODE_7:
      return KeyEvent.KEYCODE_DPAD_LEFT;
      
    case KeyEvent.KEYCODE_RIGHT_BRACKET:
    case KeyEvent.KEYCODE_DPAD_RIGHT:
    case KeyEvent.KEYCODE_3:
    case KeyEvent.KEYCODE_6:
    case KeyEvent.KEYCODE_9:
      return KeyEvent.KEYCODE_DPAD_RIGHT;
    }
    
    return code;
  }
}