jessewebb / csgo-buynds

CS:GO Buy Binds Generator
http://csgobuynds.com
Other
106 stars 15 forks source link

Better key prompt for single-key generator #2

Closed SyntaxBlitz closed 8 years ago

SyntaxBlitz commented 10 years ago

The dropdown is not a very pleasant way of picking which key to use. But it's not at all difficult to create a convenient key-picking interface. I suggest letting the user click on a button that will take the next pressed key and use it as the bind. You'd need to store data for which scancodes correspond to specially named keys in the source engine, but this would also allow you to conveniently let the user bind any key on his keyboard without using a massive dropdown.

jessewebb commented 10 years ago

I like the idea of letting them just press any key, thank you for the suggestion! I will see what I can do...

UsainBloot commented 9 years ago

http://dmauro.github.io/Keypress/

This could be a good library to capture key press events. Could then also include a key value list to map the library's key name to CSGO's key name.

I could fork this feature if you like, once I have access to a num pad.

jessewebb commented 9 years ago

I am working on this feature right now on the dev branch. Here is what I have so far, let me know what you think...

On the single-key generator, I have added a second control to the 'Key to Bind' options. Below the drop-down, there is a button and a disabled text box. image

When you click 'Select Key' button, it activates the browser's PointerLock functionality (to disable mouse input temporarily) and starts listening for any key press. image

When you press any button on the keyboard, the page re-enables your mouse. I have mapped the keys on the keyboard to the different CS:GO inputs so it registers the proper 'Key to Bind' option. image

Also, I have left the drop-down menu there as well and the two controls are kept in sync; you can choose a 'Key to Bind' with either the <select> drop-down or the new key-recognition control.

SyntaxBlitz commented 9 years ago

Ooh, that's really cool. I love your implementation!

jessewebb commented 9 years ago

I have finished work on this issue in the dev branch. It is scheduled to be released as part of version 0.8. I only have a couple more tasks to finish up before the release so hopefully it won't take to long for you to see this feature go live.