Better key prompt for single-key generator #2

Closed
SyntaxBlitz opened this Issue Oct 5, 2014 · 5 comments

Projects

None yet

3 participants

@SyntaxBlitz

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
Owner

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

@UsainBloot

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
Owner

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

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
15505e3
@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
78e77e1
@jessewebb
Owner

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