Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
a7b0db06
Commit
a7b0db06
authored
Aug 16, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keys: allow inverting positioning wheel (fixes #4748)
parent
67aa058b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
26 deletions
+38
-26
src/config/keys.c
src/config/keys.c
+32
-22
src/libvlc-module.c
src/libvlc-module.c
+6
-4
No files found.
src/config/keys.c
View file @
a7b0db06
...
...
@@ -438,6 +438,34 @@ static int vlc_AddMapping (void **map, uint32_t keycode, vlc_action_t action)
return
0
;
}
static
void
vlc_AddWheelMapping
(
void
**
map
,
uint32_t
kmore
,
uint32_t
kless
,
int
mode
)
{
vlc_action_t
amore
=
ACTIONID_NONE
,
aless
=
ACTIONID_NONE
;
switch
(
mode
)
{
case
0
:
/* volume up/down */
amore
=
ACTIONID_VOL_UP
;
aless
=
ACTIONID_VOL_DOWN
;
break
;
case
2
:
/* position latter/earlier */
amore
=
ACTIONID_JUMP_FORWARD_EXTRASHORT
;
aless
=
ACTIONID_JUMP_BACKWARD_EXTRASHORT
;
break
;
case
3
:
/* position earlier/latter */
amore
=
ACTIONID_JUMP_BACKWARD_EXTRASHORT
;
aless
=
ACTIONID_JUMP_FORWARD_EXTRASHORT
;
break
;
}
if
(
amore
!=
ACTIONID_NONE
)
vlc_AddMapping
(
map
,
kmore
,
amore
);
if
(
aless
!=
ACTIONID_NONE
)
vlc_AddMapping
(
map
,
kless
,
aless
);
}
/**
* Sets up all key mappings for a given action.
* \param map tree (of struct mapping entries) to write mappings to
...
...
@@ -511,28 +539,10 @@ struct vlc_actions *vlc_InitActions (libvlc_int_t *libvlc)
keys
->
psz_action
=
NULL
;
/* Initialize mouse wheel events */
int
xmode
=
var_InheritInteger
(
obj
,
"hotkeys-x-wheel-mode"
);
if
(
xmode
<
2
)
{
vlc_AddMapping
(
&
as
->
map
,
KEY_MOUSEWHEELLEFT
,
xmode
?
ACTIONID_JUMP_BACKWARD_EXTRASHORT
:
ACTIONID_VOL_DOWN
);
vlc_AddMapping
(
&
as
->
map
,
KEY_MOUSEWHEELRIGHT
,
xmode
?
ACTIONID_JUMP_FORWARD_EXTRASHORT
:
ACTIONID_VOL_UP
);
}
int
ymode
=
var_InheritInteger
(
obj
,
"hotkeys-y-wheel-mode"
);
if
(
ymode
<
2
)
{
vlc_AddMapping
(
&
as
->
map
,
KEY_MOUSEWHEELDOWN
,
ymode
?
ACTIONID_JUMP_BACKWARD_EXTRASHORT
:
ACTIONID_VOL_DOWN
);
vlc_AddMapping
(
&
as
->
map
,
KEY_MOUSEWHEELUP
,
ymode
?
ACTIONID_JUMP_FORWARD_EXTRASHORT
:
ACTIONID_VOL_UP
);
}
vlc_AddWheelMapping
(
&
as
->
map
,
KEY_MOUSEWHEELRIGHT
,
KEY_MOUSEWHEELLEFT
,
var_InheritInteger
(
obj
,
"hotkeys-x-wheel-mode"
));
vlc_AddWheelMapping
(
&
as
->
map
,
KEY_MOUSEWHEELUP
,
KEY_MOUSEWHEELDOWN
,
var_InheritInteger
(
obj
,
"hotkeys-y-wheel-mode"
));
libvlc
->
p_hotkeys
=
as
->
keys
;
var_AddCallback
(
obj
,
"key-pressed"
,
vlc_key_to_action
,
&
as
->
map
);
...
...
src/libvlc-module.c
View file @
a7b0db06
...
...
@@ -1172,9 +1172,11 @@ static const char *const ppsz_prefres[] = {
#define HOTKEY_CAT_LONGTEXT N_( "These settings are the global VLC key " \
"bindings, known as \"hotkeys\"." )
static
const
int
mouse_wheel_values
[]
=
{
2
,
0
,
1
};
static
const
char
*
const
mouse_wheel_texts
[]
=
{
N_
(
"Ignore"
),
N_
(
"Volume Control"
),
N_
(
"Position Control"
)
};
static
const
int
mouse_wheel_values
[]
=
{
-
1
,
0
,
2
,
3
,
};
static
const
char
*
const
mouse_wheel_texts
[]
=
{
N_
(
"Ignore"
),
N_
(
"Volume control"
),
N_
(
"Position control"
),
N_
(
"Position control reversed"
),
};
#define MOUSE_Y_WHEEL_MODE_TEXT N_("Mouse wheel vertical axis control")
#define MOUSE_Y_WHEEL_MODE_LONGTEXT N_( \
...
...
@@ -2094,7 +2096,7 @@ vlc_module_begin ()
add_integer
(
"hotkeys-y-wheel-mode"
,
0
,
MOUSE_Y_WHEEL_MODE_TEXT
,
MOUSE_Y_WHEEL_MODE_LONGTEXT
,
false
)
change_integer_list
(
mouse_wheel_values
,
mouse_wheel_texts
)
add_integer
(
"hotkeys-x-wheel-mode"
,
1
,
MOUSE_X_WHEEL_MODE_TEXT
,
add_integer
(
"hotkeys-x-wheel-mode"
,
2
,
MOUSE_X_WHEEL_MODE_TEXT
,
MOUSE_X_WHEEL_MODE_LONGTEXT
,
false
)
change_integer_list
(
mouse_wheel_values
,
mouse_wheel_texts
)
add_obsolete_integer
(
"hotkeys-mousewheel-mode"
)
/* since 3.0.0 */
...
...
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