Page 1 of 1

How to disable the spacebar

Posted: Fri Mar 15, 2019 6:22 pm
by billmand
I have been developing and testing a new system and have run into an issue with the spacebar. We have a requirement that states that the spacebar cannot act as the enter/select key. Currently, the space will select buttons, check boxes, radio buttons, etc. Is there a way to disable to catch the spacebar in WinCC OA 3.16 P006? Also, this is being run on Linux.

Would appreciate any help in this matter.

Thanks...

Re: How to disable the spacebar

Posted: Mon Mar 18, 2019 10:02 am
by LIGO
Hi.

Unfortunately, it seems to be some OS-default setting for those default widgets (buttons, checkboxes etc.) and I didn't find a way of disabling or catching it inside WinCC OA (for example, with event mapping into "Clicked").

But there is a very dirty workaround to disable spacebar on your panel. Just place an invisible button with some dummy code into "Clicked" event and configure "Hotkey" property of that button to Space. Thus, every spacebar press will envoke that dummy button.

This approach is not really nice since you need to run through all your panels/references with possible command elements but it's working :)
Also, mind the default OA messages and confirm dialogs, you might need to change those as well. For some reason, focus on those messages is placed on "Yes" command.

Best regards
Leonid Solovev

Re: How to disable the spacebar

Posted: Mon Mar 18, 2019 5:50 pm
by billmand
Thanks Leo.

You are right it may be a dirty workaround but it does what was needed and stops any accidental selections via the spacebar.

Thanks again…

Re: How to disable the spacebar

Posted: Wed Mar 20, 2019 10:39 am
by gschijndel
LIGO wrote:
Mon Mar 18, 2019 10:02 am
This approach is not really nice since you need to run through all your panels/references with possible command elements but it's working :)
In case your application has a fixed part you could place the 'space' hotkey button on this panel, then you should not need to go through all your panels.

Re: How to disable the spacebar

Posted: Mon Jul 06, 2020 7:36 pm
by tpjctrl
I'm currently trying to come up with a solution to this and it appears that "messy" is the only way to go ie. place a hidden dummy button pretty much on every panel / most panels. Placing it in a header / footer doesn't work as moving focus away, for example when opening up a child panel, effectively re-enables the space key. Using something like AutoHotKey also isn't possible as the space key is required for any text entry fields.

Unless someone has any other ideas?