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
67a51b0b
Commit
67a51b0b
authored
Feb 10, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use + as modifier separator, keep backward compatibility with -
parent
c810198e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
27 deletions
+19
-27
src/config/keys.c
src/config/keys.c
+19
-27
No files found.
src/config/keys.c
View file @
67a51b0b
...
...
@@ -40,17 +40,6 @@ typedef struct key_descriptor_s
uint32_t
i_key_code
;
}
key_descriptor_t
;
static
const
struct
key_descriptor_s
vlc_modifiers
[]
=
{
{
"Alt"
,
KEY_MODIFIER_ALT
},
{
"Shift"
,
KEY_MODIFIER_SHIFT
},
{
"Ctrl"
,
KEY_MODIFIER_CTRL
},
{
"Meta"
,
KEY_MODIFIER_META
},
{
"Command"
,
KEY_MODIFIER_COMMAND
}
};
enum
{
vlc_num_modifiers
=
sizeof
(
vlc_modifiers
)
/
sizeof
(
struct
key_descriptor_s
)
};
static
const
struct
key_descriptor_s
vlc_keys
[]
=
{
{
"Unset"
,
KEY_UNSET
},
...
...
@@ -155,19 +144,22 @@ uint_fast32_t ConfigStringToKey (const char *name)
for
(;;)
{
const
char
*
psz_parser
=
strchr
(
name
,
'-'
);
if
(
psz_parser
==
NULL
||
psz_parser
==
name
)
size_t
len
=
strcspn
(
name
,
"-+"
);
if
(
name
[
len
]
==
'\0'
)
break
;
for
(
size_t
i
=
0
;
i
<
vlc_num_modifiers
;
i
++
)
{
if
(
!
strncasecmp
(
vlc_modifiers
[
i
].
psz_key_string
,
name
,
strlen
(
vlc_modifiers
[
i
].
psz_key_string
)))
{
mods
|=
vlc_modifiers
[
i
].
i_key_code
;
}
}
name
=
psz_parser
+
1
;
if
(
len
==
4
&&
!
strncasecmp
(
name
,
"Ctrl"
,
4
))
mods
|=
KEY_MODIFIER_CTRL
;
if
(
len
==
3
&&
!
strncasecmp
(
name
,
"Alt"
,
3
))
mods
|=
KEY_MODIFIER_ALT
;
if
(
len
==
5
&&
!
strncasecmp
(
name
,
"Shift"
,
5
))
mods
|=
KEY_MODIFIER_SHIFT
;
if
(
len
==
4
&&
!
strncasecmp
(
name
,
"Meta"
,
4
))
mods
|=
KEY_MODIFIER_META
;
if
(
len
==
7
&&
!
strncasecmp
(
name
,
"Command"
,
7
))
mods
|=
KEY_MODIFIER_COMMAND
;
name
+=
len
+
1
;
}
for
(
size_t
i
=
0
;
i
<
vlc_num_keys
;
i
++
)
...
...
@@ -188,11 +180,11 @@ char *vlc_keycode2str (uint_fast32_t code)
return
NULL
;
if
(
asprintf
(
&
str
,
"%s%s%s%s%s%s"
,
(
code
&
KEY_MODIFIER_CTRL
)
?
"Ctrl
-
"
:
""
,
(
code
&
KEY_MODIFIER_ALT
)
?
"Alt
-
"
:
""
,
(
code
&
KEY_MODIFIER_SHIFT
)
?
"Shift
-
"
:
""
,
(
code
&
KEY_MODIFIER_META
)
?
"Meta
-
"
:
""
,
(
code
&
KEY_MODIFIER_COMMAND
)
?
"Command
-
"
:
""
,
(
code
&
KEY_MODIFIER_CTRL
)
?
"Ctrl
+
"
:
""
,
(
code
&
KEY_MODIFIER_ALT
)
?
"Alt
+
"
:
""
,
(
code
&
KEY_MODIFIER_SHIFT
)
?
"Shift
+
"
:
""
,
(
code
&
KEY_MODIFIER_META
)
?
"Meta
+
"
:
""
,
(
code
&
KEY_MODIFIER_COMMAND
)
?
"Command
+
"
:
""
,
(
d
!=
NULL
)
?
d
->
psz_key_string
:
buf
)
==
-
1
)
return
NULL
;
...
...
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