Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better key prompt for single-key generator #2

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

Better key prompt for single-key generator #2

SyntaxBlitz opened this issue Oct 5, 2014 · 5 comments

Comments

@SyntaxBlitz
Copy link

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
Copy link
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
Copy link

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
Copy link
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
Copy link
Author

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

@jessewebb
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants