Reading Keyboard Events

The KeyBoardValue function may be used to read keyboard events. This is useful when you want to capture keyboard input without requiring the user to press the Enter key, for example with selections from a menu. Simply pressing the key will trigger the event.

Typical MSW Logo code ...

to KeyPressed
; Based on code suggested by George Mills
keyboardon [Keys char KeyBoardValue]
setfocus [MSWLogo Screen]
Keys "A
end

to Keys :char
if or :char ="x :char = "X [label "ok]
if or :char ="c :char = "C [ClearScreen]
end

<- Back -Menu- Next ->