Input Boxes Swallow keypresses
This is related to #646 and #860.
When edit_line has the focus, keypress doesn't get called.
For example:
Shoes.app do
keypress do |key|
p key.to_s
end
edit_line
end
If you want to see keypress's you'll need to comment out the edit_line.
If you have an element on the screen other than edit_line that has focus, will the global keypress get fired? For instance if there's a button and it has focus...
From #646 (and https://github.com/shoes/shoes4/pull/646#issuecomment-40445213 in specific), it seems like I made a conscious choice to have the keypresses eaten when we're focused on a text element. That appears to have been the behavior in Shoes 3, and I think I was concerned about apps with global keypress's that would start getting unexpected textbox related input when moving to Shoes 4.
That said, I think your intuition about keypress seeing everything is what most people would have when coming to the code, so perhaps this is worth revising. Since it would be a significant behavior change from Shoes 3 (I think... worth confirming) does this seem more like a 4.1 thing to handle?
This might be a discussion up for 4.1. But I think it is fine as it is. We could provide a keypress option, like global: true to get that behavior (optionally).