Can I stop space and enter from toggling my checkbutton? [Godot]

  • Thread starter Thread starter Darkmisc
  • Start date Start date
  • Tags Tags
    godot
AI Thread Summary
The discussion revolves around an issue where the space and enter keys unintentionally toggle a checkbutton in a game, despite not being programmed to do so. The user prefers these keys for jumping and shooting but seeks a solution to prevent them from affecting the checkbutton. Suggestions include using a keyboard re-mapper as a workaround, placing the checkbox GUI on a separate screen to avoid conflicts, and coding specific input events to either ignore or reverse the toggling action of the checkbutton. Additionally, resources related to the Godot Engine's checkbox functionality and keyboard remapping tools like AutoHotkey are shared for further assistance.
Darkmisc
Messages
222
Reaction score
31
TL;DR Summary
I use space and enter as buttons for jump and shoot respectively. I have a checkbutton in my game for toggling the visibility of a display. It turns out space and enter also toggle my checkbutton.
Hi everyone

I use space and enter as buttons for jump and shoot respectively. I have a checkbutton in my game for toggling the visibility of a display. It turns out space and enter also toggle my checkbutton. I didn't code for space and enter to do this. I can't find anywhere on the inspector where keys are assigned to the checkbutton.

So far as I'm aware, no other keys toggle my checkbutton. I could change my keys for jump and shoot, but space and enter seem to be the best keys for this.

Is there anyway to stop space and enter from toggling my checkbutton?Thanks
 
Technology news on Phys.org
Clunky fix, but you could use a keyboard re-mapper.
 
  • Like
Likes robphy and Darkmisc
What language and UI framework are you using?
Later: Failed to notice [Godot] stuck at the end of the subject title.
 
Last edited:
place your checkbox gui stuff on a separate screen from your game so that won't happen.

I'm assuming you're using javascript in a web app.

Here's the Godot Engine info on checkbox

https://docs.godotengine.org/en/stable/classes/class_checkbox.html

Maybe by using a checkbutton and toggling it with code will solve this issue as you have to use a mouse to give it focus and then to press it.
 
Darkmisc said:
I didn't code for space and enter to do this.
What if you do code those input events to do something with your checkbutton? Either "don't do anything" or "undo toggling action" might do the trick.
 
  • Like
Likes robphy, Wrichik Basu, Darkmisc and 2 others
hmmm27 said:
Clunky fix, but you could use a keyboard re-mapper.

jack action said:
What if you do code those input events to do something with your checkbutton? Either "don't do anything" or "undo toggling action" might do the trick.

Possibly useful: https://www.autohotkey.com/docs/v1/misc/Override.htm
 
  • Like
Likes hmmm27 and Darkmisc
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top