SDL-0.6.6.0: Binding to libSDL

Copyright(c) David Himmelstrup 2005
LicenseBSD-like
Maintainerlemmih@gmail.com
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Graphics.UI.SDL.Events

Description

 

Synopsis

Documentation

data Event Source #

High level event structure.

Constructors

NoEvent 
GotFocus [Focus] 
LostFocus [Focus] 
KeyDown !Keysym 
KeyUp !Keysym 
MouseMotion !Word16 !Word16 !Int16 !Int16 
MouseButtonDown !Word16 !Word16 !MouseButton 
MouseButtonUp !Word16 !Word16 !MouseButton 
JoyAxisMotion !Word8 !Word8 !Int16

device index, axis index, axis value.

JoyBallMotion !Word8 !Word8 !Int16 !Int16

device index, trackball index, relative motion.

JoyHatMotion !Word8 !Word8 !Word8

device index, hat index, hat position.

JoyButtonDown !Word8 !Word8

device index, button index.

JoyButtonUp !Word8 !Word8

device index, button index.

VideoResize !Int !Int

When Resizable is passed as a flag to setVideoMode the user is allowed to resize the applications window. When the window is resized an VideoResize is reported, with the new window width and height values. When an VideoResize is recieved the window should be resized to the new dimensions using setVideoMode.

VideoExpose

A VideoExpose event is triggered when the screen has been modified outside of the application, usually by the window manager and needs to be redrawn.

Quit 
User !UserEventID !Int !(Ptr ()) !(Ptr ()) 
Unknown 

Instances

toSafePtr :: Typeable a => a -> IO SafePtr Source #

Constructs a safe pointer from an arbitrary value.

tryFromSafePtr :: Typeable a => SafePtr -> IO (Maybe a) Source #

Get object from a safe pointer. Nothing on type mismatch.

fromSafePtr :: Typeable a => SafePtr -> IO a Source #

Get object from a safe pointer. Throws an exception on type mismatch.

typeOfSafePtr :: SafePtr -> IO TypeRep Source #

Return the type of the object the safe pointer was created from.

enableKeyRepeat Source #

Arguments

:: Int

Initial delay. 0 to disable.

-> Int

Interval.

-> IO Bool 

Sets keyboard repeat rate. Returns False on error.

enableUnicode :: Bool -> IO () Source #

Enables or disables unicode translation.

queryUnicodeState :: IO Bool Source #

Returns the current state of unicode translation. See also enableUnicode.

getKeyName :: SDLKey -> String Source #

Gets the name of an SDL virtual keysym.

getMouseState :: IO (Int, Int, [MouseButton]) Source #

Retrieves the current state of the mouse. Returns (X position, Y position, pressed buttons).

getRelativeMouseState :: IO (Int, Int, [MouseButton]) Source #

Retrieve the current state of the mouse. Like getMouseState except that X and Y are set to the change since last call to getRelativeMouseState.

getModState :: IO [Modifier] Source #

Gets the state of modifier keys.

setModState :: [Modifier] -> IO () Source #

Sets the internal state of modifier keys.

tryPushEvent :: Event -> IO Bool Source #

Pushes an event onto the event queue. Returns False on error.

pushEvent :: Event -> IO () Source #

Pushes an event onto the event queue. Throws an exception on error.

pollEvent :: IO Event Source #

Polls for currently pending events.

waitEvent :: IO Event Source #

Waits indefinitely for the next available event.

waitEventBlocking :: IO Event Source #

Waits indefinitely for the next available event. Blocks Haskell threads.

pumpEvents :: IO () Source #

Pumps the event loop, gathering events from the input devices.

enableEvent :: SDLEvent -> Bool -> IO () Source #

Enable or disable events from being processed.

queryEventState :: SDLEvent -> IO Bool Source #

Checks current state of a event. See also enableEvent.

getAppState :: IO [Focus] Source #

Gets the state of the application.