react-shortcuts icon indicating copy to clipboard operation
react-shortcuts copied to clipboard

[suggestion/idea] The scope of the project, possible semantics / scope change?

Open jfrux opened this issue 6 years ago • 0 comments

First off, love your project. This is great and I love the declarative nature of this. It aligns with my view of how input should be managed for web apps and software in general.

I think the name is misleading a bit since its really an input library. Since not every React app uses keyboards, and not every input is a shortcut, I think that the library is handling input. For instance, a react app running within a Universal Windows Application or in a Connected TV environment would have various other input codes / context that wouldn't fall between the normal Windows + Mac context, but rather a various broader context.

Xbox One apps for instance would have codes like:

AD_DPAD_DOWN: 204,
  GAMEPAD_DPAD_LEFT: 205,
  GAMEPAD_DPAD_RIGHT: 206,
  GAMEPAD_MENU: 207,
  GAMEPAD_VIEW: 208,
  GAMEPAD_LEFT_THUMBSTICK_PRESS: 209,
  GAMEPAD_RIGHT_THUMBSTICK_PRESS: 210,
  GAMEPAD_LEFT_THUMBSTICK_UP: 211,
  GAMEPAD_LEFT_THUMBSTICK_DOWN: 212,
  GAMEPAD_LEFT_THUMBSTICK_RIGHT: 213,
  GAMEPAD_LEFT_THUMBSTICK_LEFT: 214,
  GAMEPAD_RIGHT_THUMBSTICK_UP: 215,
  GAMEPAD_RIGHT_THUMBSTICK_DOWN: 216,
  GAMEPAD_RIGHT_THUMBSTICK_RIGHT: 217,
  GAMEPAD_RIGHT_THUMBSTICK_LEFT: 218
};
export default {
  UP: xboxKeys.GAMEPAD_DPAD_UP,
  UP_ALT: xboxKeys.GAMEPAD_LEFT_THUMBSTICK_UP,
  UP_ALT2: xboxKeys.GAMEPAD_RIGHT_THUMBSTICK_UP,
  DOWN: xboxKeys.GAMEPAD_DPAD_DOWN,
  DOWN_ALT: xboxKeys.GAMEPAD_LEFT_THUMBSTICK_DOWN,
  DOWN_ALT2: xboxKeys.GAMEPAD_RIGHT_THUMBSTICK_DOWN,
  LEFT: xboxKeys.GAMEPAD_DPAD_LEFT,
  LEFT_ALT: xboxKeys.GAMEPAD_LEFT_THUMBSTICK_LEFT,
  LEFT_ALT2: xboxKeys.GAMEPAD_RIGHT_THUMBSTICK_LEFT,
  RIGHT: xboxKeys.GAMEPAD_DPAD_RIGHT,
  RIGHT_ALT: xboxKeys.GAMEPAD_LEFT_THUMBSTICK_RIGHT,
  RIGHT_ALT2: xboxKeys.GAMEPAD_RIGHT_THUMBSTICK_RIGHT,
  ENTER: xboxKeys.GAMEPAD_A,
  BACK: xboxKeys.GAMEPAD_B,
  BACK_ALT: 27,
  INFO: xboxKeys.GAMEPAD_VIEW,
  SETTINGS: xboxKeys.GAMEPAD_MENU,
  NUM_0: xboxKeys.GAMEPAD_LEFT_TRIGGER,
  NUM_1: xboxKeys.GAMEPAD_RIGHT_TRIGGER,
  NUM_2: xboxKeys.GAMEPAD_LEFT_SHOULDER,
  NUM_3: xboxKeys.GAMEPAD_RIGHT_SHOULDER
};

Yet we would want to ensure they are usable within this type of environment or configuration method. Rather than trying to support or define the inputs, would it not make sense to have those defined as configs or pluggable logic based on the expansive nature of the library?

Just my thoughts and two-cents. Rather than looking at it like a React DOM problem or a Web Browser solution, the React is becoming such a broader used toolchain that impacts more platforms than just web.

jfrux avatar May 02 '18 11:05 jfrux