Hello again , could someone tell me the syntax for a keybord input ? I want to write a method which ask for keyboard input. Is this possible. Hans
On 27 Oct 2014, at 21:08, Hans Schueren <werbung@hans-schueren.de> wrote:
Hello again ,
could someone tell me the syntax for a keybord input ?
I want to write a method which ask for keyboard input.
Is this possible.
Hans
The easiest way that is available is like this: UIManager default request: 'What is your name ?'. UIManager default confirm: 'Do you like Pharo ?'. Try inspecting each expression separately. HTH, Sven
yes again if you browse Morphic you will find the event-handling protocol two methods I tested is handleKeyStroke: that should return true so that your morph handles key strokes events and then you need to also override keyStroke: itself to do whatever you want to do, from there on you can check the KeyboardEvent class to see what the event that is passed to keyStroke: as argument is. for example keyStroke: event event inspect. (event keyCharacter = $h) ifTrue: [ Transcript open. Transcript show: 'Hello User and welcome to Pharo :) '] the above assume you have created a class that is subclass of Morph and you override the methods mentioned in that class. On Mon, Oct 27, 2014 at 10:08 PM, Hans Schueren <werbung@hans-schueren.de> wrote:
Hello again ,
could someone tell me the syntax for a keybord input ?
I want to write a method which ask for keyboard input.
Is this possible.
Hans
participants (3)
-
Hans Schueren -
kilon alios -
Sven Van Caekenberghe