Better key prompt for single-key generator #2

SyntaxBlitz opened this Issue Oct 5, 2014 · 5 comments


None yet

3 participants


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.


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


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.


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.

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.

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.

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.


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

@jessewebb jessewebb added a commit that referenced this issue Jul 18, 2015
@jessewebb Issue #2 - Fixed some bugs related to how the SKG key-recognition con…
…trol used PointerLock
@jessewebb jessewebb added a commit that referenced this issue Jul 19, 2015
@jessewebb Issue #2 - Refactored out the SKG key-recognition control into a pres…
…sAnyKeyButton directive

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.

@jessewebb jessewebb closed this Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment