[HOpenGL] mouseFunc vs. UserInput

Sven Panne Sven.Panne@informatik.uni-muenchen.de
Fri, 10 May 2002 23:16:14 +0200


Andre W B Furtado wrote:
 > With the mouseFunc callback, it is very easy to recognize if the user has
 > clicked in a point that belongs to a square: [...]
 > I'm trying to do the same using module UserInput.hs. [...]

First of all, I've never imagined that anybody would actually have a deeper
look at examples/misc...  :-)

My suggestion is to extend the type of the callback action, i.e. change

    type KeyBinder = Key -> KeyEvent -> Maybe (IO ()) -> IO ()

to

    type KeyBinder = Key -> KeyEvent -> Maybe (WindowPosition -> IO ()) -> IO ()

and adapt UserInput.initUserInput in the obvious way. Does this help?

Cheers,
    S.