Mercurial > sdl-ios-xcode
view docs/man3/SDLKey.3 @ 563:04dcaf3da918
Massive Quartz input enhancements from Darrell Walisser. His email:
Enclosed is a patch that addresses the following:
--Various minor cleanups.
Removed dead/obsolete code, made some style cleanups
--Mouse Events
Now keep track of what button(s) were pressed so we know when to send
the mouse up event. This fixes the case where the mouse is dragged
outside of the game window and released (in which case we want to send
the mouse up event even though the mouse is outside the game window).
--Input Grabbing
Here is my take on the grabbing situation, which is the basis for the
new implementation.
There are 3 grab states, ungrabbed (UG), visible (VG), and invisible
(IG). Both VG and IG keep the mouse constrained to the window and
produce relative motion events. In VG the cursor is visible (duh), in
IG it is not. In VG, absolute motion events also work.
There are 6 actions that can affect grabbing:
1. Set Fullscreen/Window (F/W). In fullscreen, a visible grab should do
nothing. However, a fullscreen visible grab can be treated just like a
windowed visible grab, which is what I have done to help simplify
things.
2. Cursor hide/show (H/S). If the cursor is hidden when grabbing, the
grab is an invisible grab. If the cursor is visible, the grab should
just constrain the mouse to the window.
3. Input grab/ungrab(G/U). If grabbed, the cursor should be confined to
the window as should the keyboard input. On Mac OS X, the keyboard
input is implicitly grabbed by confining the cursor, except for
command-tab which can switch away from the application. Should the
window come to the foreground if the application is deactivated and
grab input is called? This isn't necessary in this implementation
because the grab state will be asserted upon activation.
Using my notation, these are all the cases that need to be handled
(state + action = new state).
UG+U = UG
UG+G = VG or IG, if cursor is visible or not
UG+H = UG
UG+S = UG
VG+U = UG
VG+G = VG
VG+H = IG
VG+S = VG
IG+U = UG
IG+G = IG
IG+H = IG
IG+S = VG
The cases that result in the same state can be ignored in the code,
which cuts it down to just 5 cases.
Another issue is what happens when the app loses/gains input focus from
deactivate/activate or iconify/deiconify. I think that if input focus
is ever lost (outside of SDL's control), the grab state should be
suspended and the cursor should become visible and active again. When
regained, the cursor should reappear in its original location and/or
grab state. This way, when reactivating the cursor is still in the same
position as before so apps shouldn't get confused when the next motion
event comes in. This is what I've done in this patch.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Fri, 27 Dec 2002 20:52:41 +0000 |
parents | 74212992fb08 |
children | 546f7c1eb755 |
line wrap: on
line source
.TH "SDLKey" "3" "Wed 11 Oct 2000, 22:28" "SDL" "SDL API Reference" .SH "NAME" SDLKey\- SDL Keysym Definitions .SH "SDL Keysym definitions" .PP \fBSDLKey ASCII value Common Name\fR .nf \f(CWSDLK_BACKSPACE '\\b' backspace SDLK_TAB '\\t' tab SDLK_CLEAR clear SDLK_RETURN '\\r' return SDLK_PAUSE pause SDLK_ESCAPE '^[' escape SDLK_SPACE ' ' space SDLK_EXCLAIM '!' exclaim SDLK_QUOTEDBL '"' quotedbl SDLK_HASH '#' hash SDLK_DOLLAR '$' dollar SDLK_AMPERSAND '&' ampersand SDLK_QUOTE ''' quote SDLK_LEFTPAREN '(' left parenthesis SDLK_RIGHTPAREN ')' right parenthesis SDLK_ASTERISK '*' asterisk SDLK_PLUS '+' plus sign SDLK_COMMA ',' comma SDLK_MINUS '-' minus sign SDLK_PERIOD '.' period SDLK_SLASH '/' forward slash SDLK_0 '0' 0 SDLK_1 '1' 1 SDLK_2 '2' 2 SDLK_3 '3' 3 SDLK_4 '4' 4 SDLK_5 '5' 5 SDLK_6 '6' 6 SDLK_7 '7' 7 SDLK_8 '8' 8 SDLK_9 '9' 9 SDLK_COLON ':' colon SDLK_SEMICOLON ';' semicolon SDLK_LESS '<' less-than sign SDLK_EQUALS '=' equals sign SDLK_GREATER '>' greater-than sign SDLK_QUESTION '?' question mark SDLK_AT '@' at SDLK_LEFTBRACKET '[' left bracket SDLK_BACKSLASH '\\' backslash SDLK_RIGHTBRACKET ']' right bracket SDLK_CARET '^' caret SDLK_UNDERSCORE '_' underscore SDLK_BACKQUOTE '`' grave SDLK_a 'a' a SDLK_b 'b' b SDLK_c 'c' c SDLK_d 'd' d SDLK_e 'e' e SDLK_f 'f' f SDLK_g 'g' g SDLK_h 'h' h SDLK_i 'i' i SDLK_j 'j' j SDLK_k 'k' k SDLK_l 'l' l SDLK_m 'm' m SDLK_n 'n' n SDLK_o 'o' o SDLK_p 'p' p SDLK_q 'q' q SDLK_r 'r' r SDLK_s 's' s SDLK_t 't' t SDLK_u 'u' u SDLK_v 'v' v SDLK_w 'w' w SDLK_x 'x' x SDLK_y 'y' y SDLK_z 'z' z SDLK_DELETE '^?' delete SDLK_KP0 keypad 0 SDLK_KP1 keypad 1 SDLK_KP2 keypad 2 SDLK_KP3 keypad 3 SDLK_KP4 keypad 4 SDLK_KP5 keypad 5 SDLK_KP6 keypad 6 SDLK_KP7 keypad 7 SDLK_KP8 keypad 8 SDLK_KP9 keypad 9 SDLK_KP_PERIOD '.' keypad period SDLK_KP_DIVIDE '/' keypad divide SDLK_KP_MULTIPLY '*' keypad multiply SDLK_KP_MINUS '-' keypad minus SDLK_KP_PLUS '+' keypad plus SDLK_KP_ENTER '\\r' keypad enter SDLK_KP_EQUALS '=' keypad equals SDLK_UP up arrow SDLK_DOWN down arrow SDLK_RIGHT right arrow SDLK_LEFT left arrow SDLK_INSERT insert SDLK_HOME home SDLK_END end SDLK_PAGEUP page up SDLK_PAGEDOWN page down SDLK_F1 F1 SDLK_F2 F2 SDLK_F3 F3 SDLK_F4 F4 SDLK_F5 F5 SDLK_F6 F6 SDLK_F7 F7 SDLK_F8 F8 SDLK_F9 F9 SDLK_F10 F10 SDLK_F11 F11 SDLK_F12 F12 SDLK_F13 F13 SDLK_F14 F14 SDLK_F15 F15 SDLK_NUMLOCK numlock SDLK_CAPSLOCK capslock SDLK_SCROLLOCK scrollock SDLK_RSHIFT right shift SDLK_LSHIFT left shift SDLK_RCTRL right ctrl SDLK_LCTRL left ctrl SDLK_RALT right alt SDLK_LALT left alt SDLK_RMETA right meta SDLK_LMETA left meta SDLK_LSUPER left windows key SDLK_RSUPER right windows key SDLK_MODE mode shift SDLK_HELP help SDLK_PRINT print-screen SDLK_SYSREQ SysRq SDLK_BREAK break SDLK_MENU menu SDLK_POWER power SDLK_EURO euro\fR .fi .SH "SDL modifier definitions" .PP \fBSDL Modifier Meaning\fR .nf \f(CWKMOD_NONE No modifiers applicable KMOD_NUM Numlock is down KMOD_CAPS Capslock is down KMOD_LCTRL Left Control is down KMOD_RCTRL Right Control is down KMOD_RSHIFT Right Shift is down KMOD_LSHIFT Left Shift is down KMOD_RALT Right Alt is down KMOD_LALT Left Alt is down KMOD_CTRL A Control key is down KMOD_SHIFT A Shift key is down KMOD_ALT An Alt key is down\fR .fi