Discussion:
Space bar triggers pushbutton
donJ
2017-04-11 23:31:31 UTC
Permalink
Hi

I have a document window with three push buttons and a canvas. The
canvas accepts key strokes and places letters into a crossword puzzle
grid. The space bar causes the action event of one of the bush puttons
to fire.

None of the buttons is set to be default.

1) Why does it pick one buttonand not another?

The fix was easy, in Canvas keydown, I put: if asc(key) = 32 then
return true

but I don't understand why this was necessary.

Linux 2016r4, Mint 18

Thank you for your time,

Don

_______________________________________________

Xojo forum:

https://forum.xojo.com/
Lars Jensen
2017-04-14 02:03:23 UTC
Permalink
I suspect that the button has the focus by default (which is not the same
as being the default button).

But I don't use Linux so I could be wrong.

lj
Hi
I have a document window with three push buttons and a canvas. The canvas
accepts key strokes and places letters into a crossword puzzle grid. The
space bar causes the action event of one of the bush puttons to fire.
None of the buttons is set to be default.
1) Why does it pick one buttonand not another?
The fix was easy, in Canvas keydown, I put: if asc(key) = 32 then return
true
but I don't understand why this was necessary.
Linux 2016r4, Mint 18
Thank you for your time,
Don
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:

https://forum.xojo.com/

Loading...