In Moose, I want my browser to be notified whenever a user presses Command-M in any text pane.
I'm listening to the inner port, waiting for any kind of event. While there is a text event that comes in when Command-m is pressed, it doesn't contain the fact that command-m was pressed.
To verify, in Moose, modify GLMExplicitBrowser>>innerPortEvent:
by adding this is a first statement:
(aPortEvent port name asString beginsWith: 'select') ifFalse:[ aPortEvent inspect.].
Now run the following in a workspace:
|browser |
browser := GLMBasicExamples new textSelection.
browser openOn: (1 to: 100).
((browser paneNamed: #start) port: #selection) value: 2.
((browser paneNamed: #end) port: #selection) value: 5.
You get notified whenever the text changes. If you press Command-M, you don't get notified. If you accept the modified text, you get a port event on the text port that seems indistinguishable from regular text changes. I.e.: you can't see if text was accepted or not!
How can I get notified of special key presses, and text acceptances?