Skip to content

vulcancreative/keyboard-event-bus-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keyboard Event Bus PoC

Temporary repo for a frontend keyboard event bus feature PoC

Demo: https://vulcancreative.github.io/keyboard-event-bus-poc

Open src/app.tsx to see how to add a publisher and subscriber to the keyboard event bus.

This PoC consists of several moving parts:

  • KeyboardEventBus class - this is where all event publishers and subscriber temporarily stored on the memory
  • useShortcut hooks - this is a React hook to monitor key press and match it to the keyboard event publishers keys.
  • getLocalizedKey helper - a helper to translate the keyboard key code into localized keyboard key based on user's keyboard layout map

Getting started

Install depedencies:

yarn

Start development server:

yarn start