pixelate-it / pixelbattle-frontend

Main website of the Pixel Battle project
http://pixelbattle.fun/
GNU General Public License v3.0
15 stars 3 forks source link

Implementation of working with the keyboard #68

Closed EtherCD closed 2 months ago

EtherCD commented 2 months ago

Works by subscribing to a specific keypress event:

KeyboardManager.pipe.value.sub("Escape", () => console.log("Hello! You pressed Escape"))

or

KeyboardManager.pipe.value.sub("Escape", (props: KeyboardListener) => 
    console.log(`IsKeyDown: ${props.isKeyDown}. CtrlKey: ${props.ctrlKey}`)
)