[clean-list] Help with trapping Special Keys

Neil Wallis wallisn at gmail.com
Sat Nov 29 20:04:08 MET 2008


I've typed in the keyspotting program in 6.7.1 of "A Tutorial to the Clean
Object I/O Library" but do not get any responses for many of the special
keys -- namely Function Keys (F1-F12), Del, Page Up, Page Down, arrow keys,
end, and home keys. I get appropriate responses for the other special keys
(Backspace, Enter, Escape), .   I've tried it on Window Vista and XP with
the same results.

Thanks,

Neil

P.S.

Here's the program

module Keyspotting
import StdEnv, StdIO
Start :: *World -> *World
Start world
 # (wid, world) = openId world
 # window = Window "keyspotting" NilLS
  [ WindowKeyboard (const True) Able (noLS1 (spotting wid))
  , WindowId wid
  , WindowClose (noLS closeProcess)
  ]
 = startIO SDI Void (snd o openWindow Void window) [ProcessClose
closeProcess] world

where
 spotting :: Id x (PSt .l) -> PSt .l | toString x
 spotting wid x pst
  = appPIO (setWindowLook wid True (False, look (toString x))) pst

 look :: String SelectState UpdateState *Picture -> *Picture
 look text _ {newFrame} picture
  # picture = unfill newFrame picture
  # (width, picture) = getPenFontStringWidth text picture
  = drawAt {x=(w-width)/2, y=h/2} text picture
 where
  {w, h} = rectangleSize newFrame
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.science.ru.nl/pipermail/clean-list/attachments/20081129/5798b8c4/attachment.html


More information about the clean-list mailing list