code: static String typeToString(short type) {
          for (Field field : LinuxInput.class.getDeclaredFields()) {
              try {
                  if (field.getName().startsWith("EV_")
                          && field.getType() == Short.TYPE
                          && field.getShort(null) == type) {
                      return field.getName();
                  }
              } catch (IllegalAccessException e) {
              }
          }
          return new Formatter().format("0x%04x", type & 0xffff).out().toString();
      }
docs: Convert an event type to its equivalent string. This method is
  inefficient and is for debugging use only.