Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
a2f23022
Commit
a2f23022
authored
Jan 24, 2011
by
krogoway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed SDL_keysym to SDL_KeySym
Renamed SDL_scancode to SDL_ScanCode Added #defines to SDL_compat.h
parent
477689ac
Changes
29
Show whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
84 additions
and
81 deletions
+84
-81
keyboard.c
Xcode-iPhoneOS/Demos/src/keyboard.c
+4
-4
SDL_compat.h
include/SDL_compat.h
+3
-0
SDL_events.h
include/SDL_events.h
+1
-1
SDL_keyboard.h
include/SDL_keyboard.h
+9
-9
SDL_scancode.h
include/SDL_scancode.h
+2
-2
SDL_keyboard.c
src/events/SDL_keyboard.c
+8
-8
SDL_keyboard_c.h
src/events/SDL_keyboard_c.h
+2
-2
scancodes_darwin.h
src/events/scancodes_darwin.h
+1
-1
scancodes_linux.h
src/events/scancodes_linux.h
+1
-1
scancodes_windows.h
src/events/scancodes_windows.h
+1
-1
scancodes_xfree86.h
src/events/scancodes_xfree86.h
+2
-2
SDL_androidkeyboard.c
src/video/android/SDL_androidkeyboard.c
+3
-3
SDL_BWin.h
src/video/bwindow/SDL_BWin.h
+2
-2
SDL_cocoakeyboard.m
src/video/cocoa/SDL_cocoakeyboard.m
+10
-10
SDL_DirectFB_events.c
src/video/directfb/SDL_DirectFB_events.c
+11
-11
SDL_photon.c
src/video/photon/SDL_photon.c
+1
-1
SDL_photon_input.c
src/video/photon/SDL_photon_input.c
+2
-2
SDL_photon_input.h
src/video/photon/SDL_photon_input.h
+1
-1
SDL_riscosevents.c
src/video/riscos/SDL_riscosevents.c
+4
-4
SDL_uikitview.m
src/video/uikit/SDL_uikitview.m
+2
-2
keyinfotable.h
src/video/uikit/keyinfotable.h
+2
-2
SDL_windowskeyboard.c
src/video/windows/SDL_windowskeyboard.c
+1
-1
SDL_windowsvideo.h
src/video/windows/SDL_windowsvideo.h
+1
-1
SDL_x11events.c
src/video/x11/SDL_x11events.c
+1
-1
SDL_x11keyboard.c
src/video/x11/SDL_x11keyboard.c
+5
-5
SDL_x11video.h
src/video/x11/SDL_x11video.h
+1
-1
checkkeys.c
test/checkkeys.c
+1
-1
testkeys.c
test/testkeys.c
+1
-1
testwm.c
test/testwm.c
+1
-1
No files found.
Xcode-iPhoneOS/Demos/src/keyboard.c
View file @
a2f23022
...
...
@@ -34,7 +34,7 @@ static SDL_Color bg_color = { 50, 50, 100, 255 }; /* color of background *
*/
typedef
struct
{
SDL_
scanc
ode
scancode
;
/* scancode of the key we want to map */
SDL_
ScanC
ode
scancode
;
/* scancode of the key we want to map */
int
allow_no_mod
;
/* is the map valid if the key has no modifiers? */
SDLMod
mod
;
/* what modifiers are allowed for the mapping */
int
index
;
/* what index in the font does the scancode map to */
...
...
@@ -103,7 +103,7 @@ fontMapping map[TABLE_SIZE] = {
};
/*
This function maps an SDL_
keys
ym to an index in the bitmap font.
This function maps an SDL_
KeyS
ym to an index in the bitmap font.
It does so by scanning through the font mapping table one entry
at a time.
...
...
@@ -113,7 +113,7 @@ fontMapping map[TABLE_SIZE] = {
If there is no entry for the key, -1 is returned
*/
int
keyToIndex
(
SDL_
keys
ym
key
)
keyToIndex
(
SDL_
KeyS
ym
key
)
{
int
i
,
index
=
-
1
;
for
(
i
=
0
;
i
<
TABLE_SIZE
;
i
++
)
{
...
...
@@ -240,7 +240,7 @@ main(int argc, char *argv[])
SDL_Window
*
window
;
SDL_Event
event
;
/* last event received */
SDLMod
mod
;
/* key modifiers of last key we pushed */
SDL_
scanc
ode
scancode
;
/* scancode of last key we pushed */
SDL_
ScanC
ode
scancode
;
/* scancode of last key we pushed */
if
(
SDL_Init
(
SDL_INIT_VIDEO
)
<
0
)
{
printf
(
"Error initializing SDL: %s"
,
SDL_GetError
());
...
...
include/SDL_compat.h
View file @
a2f23022
...
...
@@ -223,6 +223,9 @@ struct SDL_SysWMinfo;
*/
/*@{*/
#define SDL_keysym SDL_KeySym
#define SDL_scancode SDL_ScanCode
/**
* \name Renamed keys
*
...
...
include/SDL_events.h
View file @
a2f23022
...
...
@@ -151,7 +151,7 @@ typedef struct SDL_KeyboardEvent
Uint8
repeat
;
/**< Non-zero if this is a key repeat */
Uint8
padding2
;
Uint8
padding3
;
SDL_
keys
ym
keysym
;
/**< The key that was pressed or released */
SDL_
KeyS
ym
keysym
;
/**< The key that was pressed or released */
}
SDL_KeyboardEvent
;
#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
...
...
include/SDL_keyboard.h
View file @
a2f23022
...
...
@@ -45,13 +45,13 @@ extern "C" {
/**
* \brief The SDL keysym structure, used in key events.
*/
typedef
struct
SDL_
keys
ym
typedef
struct
SDL_
KeyS
ym
{
SDL_
scancode
scancode
;
/**< SDL physical key code - see ::SDL_scanc
ode for details */
SDL_
ScanCode
scancode
;
/**< SDL physical key code - see ::SDL_ScanC
ode for details */
SDLKey
sym
;
/**< SDL virtual key code - see ::SDLKey for details */
Uint16
mod
;
/**< current key modifiers */
Uint32
unicode
;
/**< \deprecated use SDL_TextInputEvent instead */
}
SDL_
keys
ym
;
}
SDL_
KeyS
ym
;
/* Function prototypes */
...
...
@@ -65,7 +65,7 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
*
* \param numkeys if non-NULL, receives the length of the returned array.
*
* \return An array of key states. Indexes into this array are obtained by using ::SDL_
scanc
ode values.
* \return An array of key states. Indexes into this array are obtained by using ::SDL_
ScanC
ode values.
*
* \b Example:
* \code
...
...
@@ -97,17 +97,17 @@ extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate);
*
* \sa SDL_GetKeyName()
*/
extern
DECLSPEC
SDLKey
SDLCALL
SDL_GetKeyFromScancode
(
SDL_
scanc
ode
scancode
);
extern
DECLSPEC
SDLKey
SDLCALL
SDL_GetKeyFromScancode
(
SDL_
ScanC
ode
scancode
);
/**
* \brief Get the scancode corresponding to the given key code according to the
* current keyboard layout.
*
* See ::SDL_
scanc
ode for details.
* See ::SDL_
ScanC
ode for details.
*
* \sa SDL_GetScancodeName()
*/
extern
DECLSPEC
SDL_
scanc
ode
SDLCALL
SDL_GetScancodeFromKey
(
SDLKey
key
);
extern
DECLSPEC
SDL_
ScanC
ode
SDLCALL
SDL_GetScancodeFromKey
(
SDLKey
key
);
/**
* \brief Get a human-readable name for a scancode.
...
...
@@ -117,9 +117,9 @@ extern DECLSPEC SDL_scancode SDLCALL SDL_GetScancodeFromKey(SDLKey key);
* copy it. If the scancode doesn't have a name, this function returns
* an empty string ("").
*
* \sa SDL_
scanc
ode
* \sa SDL_
ScanC
ode
*/
extern
DECLSPEC
const
char
*
SDLCALL
SDL_GetScancodeName
(
SDL_
scanc
ode
extern
DECLSPEC
const
char
*
SDLCALL
SDL_GetScancodeName
(
SDL_
ScanC
ode
scancode
);
/**
...
...
include/SDL_scancode.h
View file @
a2f23022
...
...
@@ -35,7 +35,7 @@
* \brief The SDL keyboard scancode representation.
*
* Values of this type are used to represent keyboard keys, among other places
* in the \link SDL_
keys
ym::scancode key.keysym.scancode \endlink field of the
* in the \link SDL_
KeyS
ym::scancode key.keysym.scancode \endlink field of the
* SDL_Event structure.
*
* The values in this enumeration are based on the USB usage page standard:
...
...
@@ -392,7 +392,7 @@ typedef enum
SDL_NUM_SCANCODES
=
512
/**< not a key, just marks the number of scancodes
for array bounds */
}
SDL_
scanc
ode
;
}
SDL_
ScanC
ode
;
#endif
/* _SDL_scancode_h */
...
...
src/events/SDL_keyboard.c
View file @
a2f23022
...
...
@@ -562,7 +562,7 @@ void
SDL_ResetKeyboard
(
void
)
{
SDL_Keyboard
*
keyboard
=
&
SDL_keyboard
;
SDL_
scanc
ode
scancode
;
SDL_
ScanC
ode
scancode
;
for
(
scancode
=
0
;
scancode
<
SDL_NUM_SCANCODES
;
++
scancode
)
{
if
(
keyboard
->
keystate
[
scancode
]
==
SDL_PRESSED
)
{
...
...
@@ -590,7 +590,7 @@ SDL_SetKeymap(int start, SDLKey * keys, int length)
}
void
SDL_SetScancodeName
(
SDL_
scanc
ode
scancode
,
const
char
*
name
)
SDL_SetScancodeName
(
SDL_
ScanC
ode
scancode
,
const
char
*
name
)
{
SDL_scancode_names
[
scancode
]
=
name
;
}
...
...
@@ -638,7 +638,7 @@ SDL_SetKeyboardFocus(SDL_Window * window)
}
int
SDL_SendKeyboardKey
(
Uint8
state
,
SDL_
scanc
ode
scancode
)
SDL_SendKeyboardKey
(
Uint8
state
,
SDL_
ScanC
ode
scancode
)
{
SDL_Keyboard
*
keyboard
=
&
SDL_keyboard
;
int
posted
;
...
...
@@ -849,18 +849,18 @@ SDL_SetModState(SDLMod modstate)
}
SDLKey
SDL_GetKeyFromScancode
(
SDL_
scanc
ode
scancode
)
SDL_GetKeyFromScancode
(
SDL_
ScanC
ode
scancode
)
{
SDL_Keyboard
*
keyboard
=
&
SDL_keyboard
;
return
keyboard
->
keymap
[
scancode
];
}
SDL_
scanc
ode
SDL_
ScanC
ode
SDL_GetScancodeFromKey
(
SDLKey
key
)
{
SDL_Keyboard
*
keyboard
=
&
SDL_keyboard
;
SDL_
scanc
ode
scancode
;
SDL_
ScanC
ode
scancode
;
for
(
scancode
=
SDL_SCANCODE_UNKNOWN
;
scancode
<
SDL_NUM_SCANCODES
;
++
scancode
)
{
...
...
@@ -872,7 +872,7 @@ SDL_GetScancodeFromKey(SDLKey key)
}
const
char
*
SDL_GetScancodeName
(
SDL_
scanc
ode
scancode
)
SDL_GetScancodeName
(
SDL_
ScanC
ode
scancode
)
{
const
char
*
name
=
SDL_scancode_names
[
scancode
];
...
...
@@ -890,7 +890,7 @@ SDL_GetKeyName(SDLKey key)
if
(
key
&
SDLK_SCANCODE_MASK
)
{
return
SDL_GetScancodeName
((
SDL_
scanc
ode
)
(
key
&
~
SDLK_SCANCODE_MASK
));
SDL_GetScancodeName
((
SDL_
ScanC
ode
)
(
key
&
~
SDLK_SCANCODE_MASK
));
}
switch
(
key
)
{
...
...
src/events/SDL_keyboard_c.h
View file @
a2f23022
...
...
@@ -43,13 +43,13 @@ extern void SDL_SetKeymap(int start, SDLKey * keys, int length);
name. Encoded as UTF-8. The string is not copied, thus the pointer given to
this function must stay valid forever (or at least until the call to
VideoQuit()). */
extern
void
SDL_SetScancodeName
(
SDL_
scanc
ode
scancode
,
const
char
*
name
);
extern
void
SDL_SetScancodeName
(
SDL_
ScanC
ode
scancode
,
const
char
*
name
);
/* Set the keyboard focus window */
extern
void
SDL_SetKeyboardFocus
(
SDL_Window
*
window
);
/* Send a keyboard key event */
extern
int
SDL_SendKeyboardKey
(
Uint8
state
,
SDL_
scanc
ode
scancode
);
extern
int
SDL_SendKeyboardKey
(
Uint8
state
,
SDL_
ScanC
ode
scancode
);
/* Send keyboard text input */
extern
int
SDL_SendKeyboardText
(
const
char
*
text
);
...
...
src/events/scancodes_darwin.h
View file @
a2f23022
...
...
@@ -27,7 +27,7 @@
- experimentation on various ADB and USB ISO keyboards and one ADB ANSI keyboard
*/
/* *INDENT-OFF* */
static
const
SDL_
scanc
ode
darwin_scancode_table
[]
=
{
static
const
SDL_
ScanC
ode
darwin_scancode_table
[]
=
{
/* 0 */
SDL_SCANCODE_A
,
/* 1 */
SDL_SCANCODE_S
,
/* 2 */
SDL_SCANCODE_D
,
...
...
src/events/scancodes_linux.h
View file @
a2f23022
...
...
@@ -26,7 +26,7 @@
- Linux kernel source input.h
*/
/* *INDENT-OFF* */
static
SDL_
scanc
ode
const
linux_scancode_table
[]
=
{
static
SDL_
ScanC
ode
const
linux_scancode_table
[]
=
{
/* 0 */
SDL_SCANCODE_UNKNOWN
,
/* 1 */
SDL_SCANCODE_ESCAPE
,
/* 2 */
SDL_SCANCODE_1
,
...
...
src/events/scancodes_windows.h
View file @
a2f23022
...
...
@@ -26,7 +26,7 @@
- msdn.microsoft.com
*/
/* *INDENT-OFF* */
static
const
SDL_
scanc
ode
windows_scancode_table
[]
=
{
static
const
SDL_
ScanC
ode
windows_scancode_table
[]
=
{
/* 0, 0x00 */
SDL_SCANCODE_UNKNOWN
,
/* 1, 0x01 */
SDL_SCANCODE_UNKNOWN
,
/* 2, 0x02 */
SDL_SCANCODE_UNKNOWN
,
...
...
src/events/scancodes_xfree86.h
View file @
a2f23022
...
...
@@ -26,7 +26,7 @@
- atKeyNames.h from XFree86 source code
*/
/* *INDENT-OFF* */
static
const
SDL_
scanc
ode
xfree86_scancode_table
[]
=
{
static
const
SDL_
ScanC
ode
xfree86_scancode_table
[]
=
{
/* 0 */
SDL_SCANCODE_UNKNOWN
,
/* 1 */
SDL_SCANCODE_ESCAPE
,
/* 2 */
SDL_SCANCODE_1
,
...
...
@@ -177,7 +177,7 @@ static const SDL_scancode xfree86_scancode_table[] = {
};
/* for wireless usb keyboard (manufacturer TRUST) without numpad. */
static
const
SDL_
scanc
ode
xfree86_scancode_table2
[]
=
{
static
const
SDL_
ScanC
ode
xfree86_scancode_table2
[]
=
{
/* 0 */
SDL_SCANCODE_UNKNOWN
,
/* 1 */
SDL_SCANCODE_ESCAPE
,
/* 2 */
SDL_SCANCODE_1
,
...
...
src/video/android/SDL_androidkeyboard.c
View file @
a2f23022
...
...
@@ -37,7 +37,7 @@ void Android_InitKeyboard()
SDL_SetKeymap
(
0
,
keymap
,
SDL_NUM_SCANCODES
);
}
static
SDL_
scanc
ode
Android_Keycodes
[]
=
{
static
SDL_
ScanC
ode
Android_Keycodes
[]
=
{
SDL_SCANCODE_UNKNOWN
,
/* AKEYCODE_UNKNOWN */
SDL_SCANCODE_UNKNOWN
,
/* AKEYCODE_SOFT_LEFT */
SDL_SCANCODE_UNKNOWN
,
/* AKEYCODE_SOFT_RIGHT */
...
...
@@ -151,10 +151,10 @@ static SDL_scancode Android_Keycodes[] = {
SDL_SCANCODE_UNKNOWN
,
/* AKEYCODE_BUTTON_MODE */
};
static
SDL_
scanc
ode
static
SDL_
ScanC
ode
TranslateKeycode
(
int
keycode
)
{
SDL_
scanc
ode
scancode
=
SDL_SCANCODE_UNKNOWN
;
SDL_
ScanC
ode
scancode
=
SDL_SCANCODE_UNKNOWN
;
if
(
keycode
<
SDL_arraysize
(
Android_Keycodes
))
{
scancode
=
Android_Keycodes
[
keycode
];
...
...
src/video/bwindow/SDL_BWin.h
View file @
a2f23022
...
...
@@ -509,7 +509,7 @@ class SDL_BWin:public BDirectWindow
if
(
msg
->
FindInt32
(
"key"
,
&
key
)
==
B_OK
&&
msg
->
FindInt32
(
"modifiers"
,
&
modifiers
)
==
B_OK
)
{
SDL_
keys
ym
keysym
;
SDL_
KeyS
ym
keysym
;
keysym
.
scancode
=
key
;
if
((
key
>
0
)
&&
(
key
<
128
))
{
keysym
.
sym
=
keymap
[
key
];
...
...
@@ -543,7 +543,7 @@ class SDL_BWin:public BDirectWindow
int32
modifiers
;
if
(
msg
->
FindInt32
(
"key"
,
&
key
)
==
B_OK
&&
msg
->
FindInt32
(
"modifiers"
,
&
modifiers
)
==
B_OK
)
{
SDL_
keys
ym
keysym
;
SDL_
KeyS
ym
keysym
;
keysym
.
scancode
=
key
;
if
((
key
>
0
)
&&
(
key
<
128
))
{
keysym
.
sym
=
keymap
[
key
];
...
...
src/video/cocoa/SDL_cocoakeyboard.m
View file @
a2f23022
...
...
@@ -246,7 +246,7 @@ static void
HandleNonDeviceModifier
(
unsigned
int
device_independent_mask
,
unsigned
int
oldMods
,
unsigned
int
newMods
,
SDL_
scanc
ode
scancode
)
SDL_
ScanC
ode
scancode
)
{
unsigned
int
oldMask
,
newMask
;
...
...
@@ -268,7 +268,7 @@ HandleNonDeviceModifier(unsigned int device_independent_mask,
*/
static
void
HandleModifierOneSide
(
unsigned
int
oldMods
,
unsigned
int
newMods
,
SDL_
scanc
ode
scancode
,
SDL_
ScanC
ode
scancode
,
unsigned
int
sided_device_dependent_mask
)
{
unsigned
int
old_dep_mask
,
new_dep_mask
;
...
...
@@ -297,8 +297,8 @@ HandleModifierOneSide(unsigned int oldMods, unsigned int newMods,
static
void
HandleModifierSide
(
int
device_independent_mask
,
unsigned
int
oldMods
,
unsigned
int
newMods
,
SDL_
scanc
ode
left_scancode
,
SDL_
scanc
ode
right_scancode
,
SDL_
ScanC
ode
left_scancode
,
SDL_
ScanC
ode
right_scancode
,
unsigned
int
left_device_dependent_mask
,
unsigned
int
right_device_dependent_mask
)
{
...
...
@@ -341,8 +341,8 @@ HandleModifierSide(int device_independent_mask,
static
void
ReleaseModifierSide
(
unsigned
int
device_independent_mask
,
unsigned
int
oldMods
,
unsigned
int
newMods
,
SDL_
scanc
ode
left_scancode
,
SDL_
scanc
ode
right_scancode
,
SDL_
ScanC
ode
left_scancode
,
SDL_
ScanC
ode
right_scancode
,
unsigned
int
left_device_dependent_mask
,
unsigned
int
right_device_dependent_mask
)
{
...
...
@@ -409,13 +409,13 @@ DoSidedModifiers(unsigned short scancode,
unsigned
int
oldMods
,
unsigned
int
newMods
)
{
/* Set up arrays for the key syms for the left and right side. */
const
SDL_
scanc
ode
left_mapping
[]
=
{
const
SDL_
ScanC
ode
left_mapping
[]
=
{
SDL_SCANCODE_LSHIFT
,
SDL_SCANCODE_LCTRL
,
SDL_SCANCODE_LALT
,
SDL_SCANCODE_LGUI
};
const
SDL_
scanc
ode
right_mapping
[]
=
{
const
SDL_
ScanC
ode
right_mapping
[]
=
{
SDL_SCANCODE_RSHIFT
,
SDL_SCANCODE_RCTRL
,
SDL_SCANCODE_RALT
,
...
...
@@ -489,7 +489,7 @@ UpdateKeymap(SDL_VideoData *data)
#endif
const
void
*
chr_data
;
int
i
;
SDL_
scanc
ode
scancode
;
SDL_
ScanC
ode
scancode
;
SDLKey
keymap
[
SDL_NUM_SCANCODES
];
/* See if the keymap needs to be updated */
...
...
@@ -675,7 +675,7 @@ Cocoa_HandleKeyEvent(_THIS, NSEvent *event)
{
SDL_VideoData
*
data
=
(
SDL_VideoData
*
)
_this
->
driverdata
;
unsigned
short
scancode
=
[
event
keyCode
];
SDL_
scanc
ode
code
;
SDL_
ScanC
ode
code
;
#if 0
const char *text;
#endif
...
...
src/video/directfb/SDL_DirectFB_events.c
View file @
a2f23022
...
...
@@ -56,11 +56,11 @@ struct _cb_data
static
SDLKey
oskeymap
[
256
];
static
SDL_
keys
ym
*
DirectFB_TranslateKey
(
_THIS
,
DFBWindowEvent
*
evt
,
SDL_
keys
ym
*
keysym
);
static
SDL_
keys
ym
*
DirectFB_TranslateKeyInputEvent
(
_THIS
,
int
index
,
static
SDL_
KeyS
ym
*
DirectFB_TranslateKey
(
_THIS
,
DFBWindowEvent
*
evt
,
SDL_
KeyS
ym
*
keysym
);
static
SDL_
KeyS
ym
*
DirectFB_TranslateKeyInputEvent
(
_THIS
,
int
index
,
DFBInputEvent
*
evt
,
SDL_
keys
ym
*
keysym
);
SDL_
KeyS
ym
*
keysym
);
static
void
DirectFB_InitOSKeymap
(
_THIS
,
SDLKey
*
keypmap
,
int
numkeys
);
static
int
DirectFB_TranslateButton
(
DFBInputDeviceButtonIdentifier
button
);
...
...
@@ -168,7 +168,7 @@ ProcessWindowEvent(_THIS, DFB_WindowData * p, Uint32 flags,
DFBWindowEvent
*
evt
)
{
SDL_DFB_DEVICEDATA
(
_this
);
SDL_
keys
ym
keysym
;
SDL_
KeyS
ym
keysym
;
char
text
[
5
];
if
(
evt
->
clazz
==
DFEC_WINDOW
)
{
...
...
@@ -300,7 +300,7 @@ static void
ProcessInputEvent
(
_THIS
,
DFBInputEvent
*
ievt
)
{
SDL_DFB_DEVICEDATA
(
_this
);
SDL_
keys
ym
keysym
;
SDL_
KeyS
ym
keysym
;
int
kbd_idx
;
char
text
[
5
];
...
...
@@ -549,8 +549,8 @@ DirectFB_InitOSKeymap(_THIS, SDLKey * keymap, int numkeys)
}
static
SDL_
keys
ym
*
DirectFB_TranslateKey
(
_THIS
,
DFBWindowEvent
*
evt
,
SDL_
keys
ym
*
keysym
)
static
SDL_
KeyS
ym
*
DirectFB_TranslateKey
(
_THIS
,
DFBWindowEvent
*
evt
,
SDL_
KeyS
ym
*
keysym
)
{
SDL_DFB_DEVICEDATA
(
_this
);
...
...
@@ -577,9 +577,9 @@ DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_keysym * keysym)
return
keysym
;
}
static
SDL_
keys
ym
*
static
SDL_
KeyS
ym
*
DirectFB_TranslateKeyInputEvent
(
_THIS
,
int
index
,
DFBInputEvent
*
evt
,
SDL_
keys
ym
*
keysym
)
SDL_
KeyS
ym
*
keysym
)
{
SDL_DFB_DEVICEDATA
(
_this
);
...
...
@@ -719,7 +719,7 @@ DirectFB_PumpEvents(_THIS)
while (devdata->eventbuffer->GetEvent(devdata->eventbuffer,
DFB_EVENT(&evt)) == DFB_OK) {
SDL_
keys
ym keysym;
SDL_
KeyS
ym keysym;
DFBInputDeviceModifierMask mod;
if (evt.clazz = DFEC_INPUT) {
...
...
src/video/photon/SDL_photon.c
View file @
a2f23022
...
...
@@ -2488,7 +2488,7 @@ photon_pumpevents(_THIS)
case
Ph_EV_KEY
:
{
PhKeyEvent_t
*
keyevent
=
NULL
;
SDL_
scanc
ode
scancode
=
SDL_SCANCODE_UNKNOWN
;
SDL_
ScanC
ode
scancode
=
SDL_SCANCODE_UNKNOWN
;
SDL_bool
pressed
=
SDL_FALSE
;
keyevent
=
PhGetData
(
event
);
...
...
src/video/photon/SDL_photon_input.c
View file @
a2f23022
...
...
@@ -460,10 +460,10 @@ photon_freemouse(SDL_Mouse * mouse)
return
;
}
SDL_
scanc
ode
SDL_
ScanC
ode
photon_to_sdl_keymap
(
uint32_t
key
)
{
SDL_
scanc
ode
scancode
=
SDL_SCANCODE_UNKNOWN
;
SDL_
ScanC
ode
scancode
=
SDL_SCANCODE_UNKNOWN
;
switch
(
key
&
0x0000007F
)
{
case
PHOTON_SCANCODE_ESCAPE
:
...
...
src/video/photon/SDL_photon_input.h
View file @
a2f23022
...
...
@@ -45,6 +45,6 @@ int32_t photon_delinputdevices(_THIS);
#define SDL_PHOTON_MOUSE_COLOR_WHITE 0xFFFFFFFF
#define SDL_PHOTON_MOUSE_COLOR_TRANS 0x00000000
SDL_
scanc
ode
photon_to_sdl_keymap
(
uint32_t
key
);
SDL_
ScanC
ode
photon_to_sdl_keymap
(
uint32_t
key
);
#endif
/* __SDL_GF_INPUT_H__ */
src/video/riscos/SDL_riscosevents.c
View file @
a2f23022
...
...
@@ -69,7 +69,7 @@ static SDLKey RO_keymap[SDLK_LAST];
static
char
RO_pressed
[
ROKEYBD_ARRAYSIZE
];
static
SDL_
keysym
*
TranslateKey
(
int
intkey
,
SDL_keys
ym
*
keysym
,
int
pressed
);
static
SDL_
KeySym
*
TranslateKey
(
int
intkey
,
SDL_KeyS
ym
*
keysym
,
int
pressed
);
void
RISCOS_PollMouse
(
_THIS
);
void
RISCOS_PollKeyboard
();
...
...
@@ -366,7 +366,7 @@ RISCOS_PollKeyboard()
int
which_key
=
ROKEY_LEFT_SHIFT
;
int
j
;
int
min_key
,
max_key
;
SDL_
keys
ym
key
;
SDL_
KeyS
ym
key
;
/* Scan the keyboard to see what is pressed */
while
(
which_key
<=
ROKEY_LAST_KEY
)
{
...
...
@@ -428,8 +428,8 @@ RISCOS_PollKeyboard()
}
}
static
SDL_
keys
ym
*
TranslateKey
(
int
intkey
,
SDL_
keys
ym
*
keysym
,
int
pressed
)
static
SDL_
KeyS
ym
*
TranslateKey
(
int
intkey
,
SDL_
KeyS
ym
*
keysym
,
int
pressed
)
{
/* Set the keysym information */
keysym
->
scancode
=
(
unsigned
char
)
intkey
;
...
...
src/video/uikit/SDL_uikitview.m
View file @
a2f23022
...
...
@@ -267,10 +267,10 @@
unichar
c
=
[
string
characterAtIndex
:
i
];
Uint16
mod
=
0
;
SDL_
scanc
ode
code
;
SDL_
ScanC
ode
code
;
if
(
c
<
127
)
{
/* figure out the SDL_
scanc
ode and SDL_keymod for this unichar */
/* figure out the SDL_
ScanC
ode and SDL_keymod for this unichar */
code
=
unicharToUIKeyInfoTable
[
c
].
code
;
mod
=
unicharToUIKeyInfoTable
[
c
].
mod
;
}
...
...
src/video/uikit/keyinfotable.h
View file @
a2f23022
...
...
@@ -27,14 +27,14 @@
/*
This file is used by the keyboard code in SDL_uikitview.m to convert between characters
passed in from the iPhone's virtual keyboard, and tuples of SDL_
scanc
odes and SDL_keymods.
passed in from the iPhone's virtual keyboard, and tuples of SDL_
ScanC
odes and SDL_keymods.
For example unicharToUIKeyInfoTable['a'] would give you the scan code and keymod for lower
case a.
*/
typedef
struct
{
SDL_
scanc
ode
code
;
SDL_
ScanC
ode
code
;
Uint16
mod
;
}
UIKitKeyInfo
;
...
...
src/video/windows/SDL_windowskeyboard.c
View file @
a2f23022
...
...
@@ -145,7 +145,7 @@ void
WIN_UpdateKeymap
()
{
int
i
;
SDL_
scanc
ode
scancode
;
SDL_
ScanC
ode
scancode
;
SDLKey
keymap
[
SDL_NUM_SCANCODES
];
SDL_GetDefaultKeymap
(
keymap
);
...
...
src/video/windows/SDL_windowsvideo.h
View file @
a2f23022
...
...
@@ -160,7 +160,7 @@ typedef struct SDL_VideoData
PFCoordTransform
CoordTransform
;
#endif
const
SDL_
scanc
ode
*
key_layout
;
const
SDL_
ScanC
ode
*
key_layout
;
DWORD
clipboard_count
;
/* Touch input functions */
...
...
src/video/x11/SDL_x11events.c
View file @
a2f23022
...
...
@@ -202,7 +202,7 @@ X11_DispatchEvent(_THIS)
case
KeyPress
:{
KeyCode
keycode
=
xevent
.
xkey
.
keycode
;
KeySym
keysym
=
NoSymbol
;
SDL_
scanc
ode
scancode
;
SDL_
ScanC
ode
scancode
;
char
text
[
SDL_TEXTINPUTEVENT_TEXT_SIZE
];
Status
status
=
0
;
...
...
src/video/x11/SDL_x11keyboard.c
View file @
a2f23022
...
...
@@ -134,7 +134,7 @@ static const struct {
static
const
struct
{
const
SDL_
scanc
ode
const
*
table
;
const
SDL_
ScanC
ode
const
*
table
;
int
table_size
;
}
scancode_set
[]
=
{
{
darwin_scancode_table
,
SDL_arraysize
(
darwin_scancode_table
)
},
...
...
@@ -175,7 +175,7 @@ X11_InitKeyboard(_THIS)
int
i
,
j
;
int
min_keycode
,
max_keycode
;
struct
{
SDL_
scanc
ode
scancode
;
SDL_
ScanC
ode
scancode
;
KeySym
keysym
;
int
value
;
}
fingerprint
[]
=
{
...
...
@@ -215,7 +215,7 @@ X11_InitKeyboard(_THIS)
printf
(
"Using scancode set %d, min_keycode = %d, max_keycode = %d, table_size = %d
\n
"
,
i
,
min_keycode
,
max_keycode
,
scancode_set
[
i
].
table_size
);
#endif
SDL_memcpy
(
&
data
->
key_layout
[
min_keycode
],
scancode_set
[
i
].
table
,
sizeof
(
SDL_
scanc
ode
)
*
scancode_set
[
i
].
table_size
);
sizeof
(
SDL_
ScanC
ode
)
*
scancode_set
[
i
].
table_size
);
fingerprint_detected
=
SDL_TRUE
;
break
;
}
...
...
@@ -239,7 +239,7 @@ X11_InitKeyboard(_THIS)
key
=
X11_KeyCodeToSDLKey
(
data
->
display
,
i
);
for
(
j
=
0
;
j
<
SDL_arraysize
(
keymap
);
++
j
)
{
if
(
keymap
[
j
]
==
key
)
{
data
->
key_layout
[
i
]
=
(
SDL_
scanc
ode
)
j
;
data
->
key_layout
[
i
]
=
(
SDL_
ScanC
ode
)
j
;
break
;
}
}
...
...
@@ -264,7 +264,7 @@ X11_UpdateKeymap(_THIS)
{
SDL_VideoData
*
data
=
(
SDL_VideoData
*
)
_this
->
driverdata
;
int
i
;
SDL_
scanc
ode
scancode
;
SDL_
ScanC
ode
scancode
;
SDLKey
keymap
[
SDL_NUM_SCANCODES
];
SDL_zero
(
keymap
);
...
...
src/video/x11/SDL_x11video.h
View file @
a2f23022
...
...
@@ -96,7 +96,7 @@ typedef struct SDL_VideoData
Atom
_NET_WM_ICON
;
Atom
UTF8_STRING
;
SDL_
scanc
ode
key_layout
[
256
];
SDL_
ScanC
ode
key_layout
[
256
];
SDL_bool
selection_waiting
;
}
SDL_VideoData
;
...
...
test/checkkeys.c
View file @
a2f23022
...
...
@@ -53,7 +53,7 @@ print_modifiers(void)
}
static
void
PrintKey
(
SDL_
keys
ym
*
sym
,
SDL_bool
pressed
,
SDL_bool
repeat
)
PrintKey
(
SDL_
KeyS
ym
*
sym
,
SDL_bool
pressed
,
SDL_bool
repeat
)
{
/* Print the keycode, name and state */
if
(
sym
->
sym
)
{
...
...
test/testkeys.c
View file @
a2f23022
...
...
@@ -11,7 +11,7 @@
int
main
(
int
argc
,
char
*
argv
[])
{
SDL_
scanc
ode
scancode
;
SDL_
ScanC
ode
scancode
;
if
(
SDL_Init
(
SDL_INIT_VIDEO
)
<
0
)
{
fprintf
(
stderr
,
"Couldn't initialize SDL: %s
\n
"
,
SDL_GetError
());
...
...
test/testwm.c
View file @
a2f23022
...
...
@@ -210,7 +210,7 @@ print_modifiers(void)
printf
(
" MODE"
);
}
static
void
PrintKey
(
const
SDL_
keys
ym
*
sym
,
int
pressed
)
static
void
PrintKey
(
const
SDL_
KeyS
ym
*
sym
,
int
pressed
)
{
/* Print the keycode, name and state */
if
(
sym
->
sym
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment