Keypress location

Hi. What would be the Right way to determine “where” on the screen a
key was pressed, ie. where the mouse pointer was ? I suspect
SDL_GetMouseState should do the trick, but i’m looking for a way to
include this in an event, so i don’t know if this will work (since it
might be called in a seperate thread).–
Trick


Linux User #229006 * http://counter.li.org

Hi. What would be the Right way to determine “where” on the screen a
key was pressed, ie. where the mouse pointer was ? I suspect
SDL_GetMouseState should do the trick, but i’m looking for a way to
include this in an event, so i don’t know if this will work (since it
might be called in a seperate thread).

Use SDL_GetMouseState()

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Use SDL_GetMouseState()

Ok, thank you! But now i’ve got another question … SDL_GetMouseState
uses int for its x and y position, while the SDL_MouseMotionEvent and
SDL_MouseButtonEvent use Uint16. Will the location gotten from
GetMouseState be the same as in those events ? Will it ever be
negative or >65536 ?

I guess not, and that may seem obvious, but i’d like to be sure =)–
Trick


Linux User #229006 * http://counter.li.org