shoes/shoes4 — pull request #646 by jasonrclark (2014-04-14 04:37:37+00:00)
Title: Move keypress listeners to move global SWT event

**:warning: WIP -- See questions at the bottom!**
PR for fixing up #384.

Key-presses were previously listened to via the `Swt::Shell.add_key_listener`. This worked ok, but had the drawback that if a button had gotten the default focus (depending on your OS conventions), then keypresses would get eaten as they were sent to the button instead of the shell.

This commit changes to use the `::Swt.display.add_filter` mechanism, which is a more global way of listening to keypresses before they get sent to the various SWT widgets on the screen. This means that we see the keypress in the filter before the button choses to eat it.

Also removed some of the unnecessary intermediate machinery around the key events vs listeners.

**Outstanding Questions to Answer Before Merging**
* A behavior change in the current code is that a keypress that activates the button still gets through but is also seen by any Shoes-level `keypress` handler--this didn't happen on Shoes3 or on earlier Shoes4. Should this be filtered out (you can easily see the focus element in the event, so it'd be easy to just not send it along).
* Similar but broader question for other elements, in particular those that receive text (`edit_line`, etc.). The prior mechanism meant that `keypress` didn't see anything that was destined for those text boxes. Should we filter those out as well?
* Lastly I'm seeing an issue with bringing up the Shoes Console via Alt+/ where the new window is seeing the keypress that was responsible for bringing it up and starts and endless chain of consoles. Kind of doesn't make sense to bring up more than one, but curious why the new window sees the old keypress.