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

added a simple printing of the key/button pressed #567

Merged
merged 3 commits into from
Mar 25, 2024

Conversation

BielBdeLuna
Copy link
Contributor

added a simple helper print method to know what key/button is being pressed, controlled via a bool cvar "in_namePressed" 1 or 0, I tested it and it works with keyboard, mouse and gamepad.

@BielBdeLuna BielBdeLuna changed the title added the printing of the key/button pressed added a simple printing of the key/button pressed Mar 23, 2024
@@ -312,6 +312,7 @@ class idKeyInput {
static const char * BindingFromKey( const char *key );
static bool KeyIsBoundTo( int keyNum, const char *binding );
static void WriteBindings( idFile *f );
static void KeyReveal( int keyNum );
Copy link
Member

@DanielGibson DanielGibson Mar 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please indent with a tab, like the lines above

*/
void idKeyInput::KeyReveal( int keyNum ) {
const char* keyName = KeyNumToString( keyNum, false );
common->Printf( "pressed the \"%s\"key.\n", keyName );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a space between \"%s\" and key

@DanielGibson
Copy link
Member

good idea, apart from the small issues I commented on this looks good to me :)

@BielBdeLuna
Copy link
Contributor Author

now done, i made the requested changes changes :)

@DanielGibson DanielGibson merged commit e024256 into dhewm:master Mar 25, 2024
@DanielGibson
Copy link
Member

merged, thank you! :)

DanielGibson pushed a commit that referenced this pull request Mar 25, 2024
added a simple helper print method to know what key/button is being pressed,
controlled via a bool cvar "in_namePressed" 1 or 0.
I tested it and it works with keyboard, mouse and gamepad.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants