Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
90ee09e8
Commit
90ee09e8
authored
Oct 07, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KeyToString: allocate key on heap
This will allow returning dynamically generated strings
parent
4acb3f1f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
10 deletions
+23
-10
include/vlc_keys.h
include/vlc_keys.h
+1
-1
modules/gui/macosx/simple_prefs.m
modules/gui/macosx/simple_prefs.m
+4
-1
modules/gui/qt4/util/customwidgets.cpp
modules/gui/qt4/util/customwidgets.cpp
+12
-5
modules/gui/skins2/events/evt_key.cpp
modules/gui/skins2/events/evt_key.cpp
+4
-1
src/config/keys.c
src/config/keys.c
+2
-2
No files found.
include/vlc_keys.h
View file @
90ee09e8
...
...
@@ -86,7 +86,7 @@
#define KEY_MOUSEWHEELLEFT 0x00F20000
#define KEY_MOUSEWHEELRIGHT 0x00F30000
VLC_EXPORT
(
c
onst
c
har
*
,
KeyToString
,
(
uint_fast32_t
i_key
)
)
LIBVLC_USED
;
VLC_EXPORT
(
char
*
,
KeyToString
,
(
uint_fast32_t
i_key
)
)
LIBVLC_USED
;
VLC_EXPORT
(
uint_fast32_t
,
StringToKey
,
(
char
*
psz_key
)
)
LIBVLC_USED
;
typedef
enum
vlc_key
{
...
...
modules/gui/macosx/simple_prefs.m
View file @
90ee09e8
...
...
@@ -86,9 +86,12 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
if
(
val
&
KEY_MODIFIER_COMMAND
)
[
o_temp_str
appendString
:
[
NSString
stringWithUTF8String
:
"
\xE2\x8C\x98
"
]];
c
onst
c
har
*
base
=
KeyToString
(
val
&
~
KEY_MODIFIER
);
char
*
base
=
KeyToString
(
val
&
~
KEY_MODIFIER
);
if
(
base
)
{
[
o_temp_str
appendString
:
[
NSString
stringWithUTF8String
:
base
]];
free
(
base
);
}
else
o_temp_str
=
[
NSMutableString
stringWithString
:
_NS
(
"Not Set"
)];
return
o_temp_str
;
...
...
modules/gui/qt4/util/customwidgets.cpp
View file @
90ee09e8
...
...
@@ -231,16 +231,23 @@ int qtWheelEventToVLCKey( QWheelEvent *e )
QString
VLCKeyToString
(
int
val
)
{
c
onst
c
har
*
base
=
KeyToString
(
val
&
~
KEY_MODIFIER
);
char
*
base
=
KeyToString
(
val
&
~
KEY_MODIFIER
);
QString
r
=
""
;
if
(
val
&
KEY_MODIFIER_CTRL
)
r
+=
"Ctrl+"
;
r
+=
qfu
(
"Ctrl+"
)
;
if
(
val
&
KEY_MODIFIER_ALT
)
r
+=
"Alt+"
;
r
+=
qfu
(
"Alt+"
)
;
if
(
val
&
KEY_MODIFIER_SHIFT
)
r
+=
"Shift+"
;
r
+=
qfu
(
"Shift+"
)
;
return
r
+
(
base
?
base
:
qtr
(
"Unset"
)
);
if
(
base
)
{
r
+=
qfu
(
base
);
free
(
base
);
}
else
r
+=
qtr
(
"Unset"
);
return
r
;
}
modules/gui/skins2/events/evt_key.cpp
View file @
90ee09e8
...
...
@@ -39,9 +39,12 @@ const string EvtKey::getAsString() const
msg_Warn
(
getIntf
(),
"Unknown action type"
);
// Add the key
c
onst
c
har
*
keyName
=
KeyToString
(
m_key
);
char
*
keyName
=
KeyToString
(
m_key
);
if
(
keyName
)
{
event
+=
(
string
)
":"
+
keyName
;
free
(
keyName
);
}
else
msg_Warn
(
getIntf
(),
"Unknown key: %d"
,
m_key
);
...
...
src/config/keys.c
View file @
90ee09e8
...
...
@@ -171,14 +171,14 @@ static int cmpkey (const void *key, const void *elem)
return
((
uintptr_t
)
key
)
-
((
key_descriptor_t
*
)
elem
)
->
i_key_code
;
}
c
onst
c
har
*
KeyToString
(
uint_fast32_t
sym
)
char
*
KeyToString
(
uint_fast32_t
sym
)
{
key_descriptor_t
*
d
;
d
=
(
key_descriptor_t
*
)
bsearch
((
void
*
)(
uintptr_t
)
sym
,
vlc_keys
,
vlc_num_keys
,
sizeof
(
vlc_keys
[
0
]),
cmpkey
);
return
d
?
d
->
psz_key_string
:
NULL
;
return
d
?
strdup
(
d
->
psz_key_string
)
:
NULL
;
}
uint_fast32_t
StringToKey
(
char
*
name
)
...
...
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