Re: [Pharo-users] How to make a Morph that gets to handle all arrow-key-events?
tx helene I prefer to think that I talk to humans :) Programming is fun in certain language. Stef On Nov 22, 2010, at 10:24 AM, Helene Bilbo wrote:
I dont think beeing reluctant must be a bad thing to learn something. If you are sceptic about something it may often lead to interesting results. And it was for sure not meant as an offence.
But in order to get help i changed the alias.
Stéphane Ducasse wrote:
Change your alias. It is childish to ask for help in programming if you do not want to program. Use any funny alias but not that one!
Stef
-- View this message in context: http://forum.world.st/How-to-make-a-Morph-that-gets-to-handle-all-arrow-key-... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
_______________________________________________ Pharo-users mailing list Pharo-users@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
Have a look at for example SimpleHierarchicalListMorph>>#keyStroke: and #arrowKey:. It handles arrow keys. Lukas On 22 November 2010 08:59, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
tx helene I prefer to think that I talk to humans :)
Programming is fun in certain language. Stef
On Nov 22, 2010, at 10:24 AM, Helene Bilbo wrote:
I dont think beeing reluctant must be a bad thing to learn something. If you are sceptic about something it may often lead to interesting results. And it was for sure not meant as an offence.
But in order to get help i changed the alias.
Stéphane Ducasse wrote:
Change your alias. It is childish to ask for help in programming if you do not want to program. Use any funny alias but not that one!
Stef
-- View this message in context: http://forum.world.st/How-to-make-a-Morph-that-gets-to-handle-all-arrow-key-... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
_______________________________________________ Pharo-users mailing list Pharo-users@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
_______________________________________________ Pharo-users mailing list Pharo-users@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
-- Lukas Renggli www.lukas-renggli.ch
Thank you, Lukas. I handle the Keystrokes like in Method 11.17 in the PharoByExample book. That part works fine. What i canât figure out is - how i can make one Morph always have the keyboard focus (in the example it gets the focus, when the mouse enters the morph and looses the focus, when the mouse leaves). - if i can let one Morph handle the arrow keys, and let keystrokes that are not arrow keys be handled by someone else. Perhaps that is not a good idea anyway and i should have some kind of playfield handling all keyevents⦠Best regards, Helene. -- View this message in context: http://forum.world.st/How-to-make-a-Morph-that-gets-to-handle-all-arrow-key-... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
On Nov 22, 2010, at 3:12 PM, Helene Bilbo wrote:
Thank you, Lukas. I handle the Keystrokes like in Method 11.17 in the PharoByExample book. That part works fine. What i canât figure out is - how i can make one Morph always have the keyboard focus (in the example it gets the focus, when the mouse enters the morph and looses the focus, when the mouse leaves).
Hi Helene, did you try Morph>>#takeKeyboardFocus ?
- if i can let one Morph handle the arrow keys, and let keystrokes that are not arrow keys be handled by someone else.
Yes you can, I think that when a key is pressed (or release), an event is thrown through the system, and each object able to catch it use the method handleEvent: Ben
Perhaps that is not a good idea anyway and i should have some kind of playfield handling all keyeventsâ¦
Best regards, Helene. -- View this message in context: http://forum.world.st/How-to-make-a-Morph-that-gets-to-handle-all-arrow-key-... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
_______________________________________________ Pharo-users mailing list Pharo-users@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
"Benjaminâ wrote:
Hi Helene, did you try Morph>>#takeKeyboardFocus ?
Thank you, Benjamin. #takeKeyboardFocus works fine - but as easy, as i can take the KeyboardFocus, as easy it is taken from my Morph as soon, as some other Morph claims the KeyboardFocus. âBenjaminâ wrote:
Yes you can, I think that when a key is pressed (or release), an event is thrown through the system, and each object able to catch it use the method handleEvent:
Can i know in which order the objects are asked whether they want to handle an Event? Can i influence this order? Thank you very much again. I already learned a lot by looking up your and Lukasâ suggestions. Helene. -- View this message in context: http://forum.world.st/How-to-make-a-Morph-that-gets-to-handle-all-arrow-key-... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
participants (4)
-
Benjamin -
Helene Bilbo -
Lukas Renggli -
Stéphane Ducasse