Stuyk / rebar-altv

Accelerate your game mode development with a simple alt:V framework written in TypeScript.
https://rebarv.com/
47 stars 24 forks source link

Feat/Req: Keydown/Keyup Event Handling for Keybinder Function #83

Closed MnkyArts closed 1 month ago

MnkyArts commented 1 month ago

Would love if we could have both Keydown and Keyup for the Serverside Keybinder. This would allow us to create more interactive and dynamic experiences by reacting immediately when a key is pressed and also when it is released.

Here maybe an idea how it could look:

const Keybinder = Rebar.useKeybinder();

Keybinder.on(75, 'keydown', (player) => {
    console.log('pressed k down');
});

Keybinder.on(75, 'keyup', (player) => {
    console.log('pressed k up');
});