Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
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
GSoC
GSoC2018
macOS
vlc
Commits
dfd588d5
Commit
dfd588d5
authored
May 23, 2018
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xcb: add support for XKB to VLC key conversion
parent
3761fcaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
modules/video_output/xcb/vlc_xkb.h
modules/video_output/xcb/vlc_xkb.h
+3
-0
modules/video_output/xcb/xkb.c
modules/video_output/xcb/xkb.c
+33
-1
No files found.
modules/video_output/xcb/vlc_xkb.h
View file @
dfd588d5
...
...
@@ -22,5 +22,8 @@
#include <stdint.h>
struct
xkb_state
;
uint_fast32_t
vlc_xkb_convert_keysym
(
uint_fast32_t
sym
);
uint_fast32_t
vlc_xkb_get_one
(
struct
xkb_state
*
state
,
uint_fast32_t
keycode
);
modules/video_output/xcb/xkb.c
View file @
dfd588d5
...
...
@@ -3,7 +3,7 @@
* @brief XKeyboard symbols mapping for VLC
*/
/*****************************************************************************
* Copyright © 2009 Rémi Denis-Courmont
* Copyright © 2009
-2018
Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
...
...
@@ -89,3 +89,35 @@ uint_fast32_t vlc_xkb_convert_keysym(uint_fast32_t sym)
return
KEY_UNSET
;
}
#ifdef HAVE_XKBCOMMON
# include <xkbcommon/xkbcommon.h>
struct
modifiers
{
char
name
[
8
];
uint32_t
mask
;
};
static
const
struct
modifiers
modifiers
[]
=
{
{
XKB_MOD_NAME_SHIFT
,
KEY_MODIFIER_SHIFT
},
{
XKB_MOD_NAME_CTRL
,
KEY_MODIFIER_CTRL
},
{
XKB_MOD_NAME_ALT
,
KEY_MODIFIER_ALT
},
{
XKB_MOD_NAME_LOGO
,
KEY_MODIFIER_META
},
};
uint_fast32_t
vlc_xkb_get_one
(
struct
xkb_state
*
state
,
uint_fast32_t
keycode
)
{
xkb_keysym_t
keysym
=
xkb_state_key_get_one_sym
(
state
,
keycode
+
8
);
uint_fast32_t
vk
=
vlc_xkb_convert_keysym
(
keysym
);
if
(
vk
!=
KEY_UNSET
)
for
(
size_t
i
=
0
;
i
<
ARRAY_SIZE
(
modifiers
);
i
++
)
if
(
xkb_state_mod_name_is_active
(
state
,
modifiers
[
i
].
name
,
XKB_STATE_MODS_EFFECTIVE
)
>
0
)
vk
|=
modifiers
[
i
].
mask
;
return
vk
;
}
#endif
/* HAVE_XKBCOMMON */
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