[Haskell-cafe] Re: How to insert character key self in sourceView?

Andy Stewart lazycat.manatee at gmail.com
Wed Mar 11 16:32:09 EDT 2009


Andy Stewart <lazycat.manatee at gmail.com> writes:

> Hi all,
>
> I use gtk2hs develop editor.
>
> I use below function handle key press event.
>
> keyPressHandler :: Event -> IO Bool
> keyPressHandler (Key {eventKeyName = keyName}) = do
>   case keyName of
>     "Escape" -> do
>       mainQuit >> return True    
>     _ -> do 
>       -- How to insert character self?
>       return True
>
I answer self.

Just modified like below:

keyPressHandler :: Event -> IO Bool
keyPressHandler (Key {eventKeyName = keyName}) = do
  case keyName of
    "Escape" -> do
      mainQuit >> return True    
    _ -> return False

Okay, now fix. :)

  -- Andy





More information about the Haskell-Cafe mailing list