Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
derf
feh
Commits
c4e8591b
Commit
c4e8591b
authored
13 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Plain Diff
Merge pull request #52 from livibetter/master
add scroll by page actions
parents
0379af96
1388cdea
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/keyevents.c
+35
-7
35 additions, 7 deletions
src/keyevents.c
src/options.h
+4
-0
4 additions, 0 deletions
src/options.h
with
39 additions
and
7 deletions
src/keyevents.c
+
35
−
7
View file @
c4e8591b
...
...
@@ -50,22 +50,22 @@ static void feh_set_parse_kb_partial(fehkey *key, int index, char *ks) {
return
;
}
if
(
ks
[
1
]
==
'-'
)
{
switch
(
ks
[
0
])
{
while
(
cur
[
1
]
==
'-'
)
{
switch
(
cur
[
0
])
{
case
'C'
:
mod
=
ControlMask
;
mod
|
=
ControlMask
;
break
;
case
'1'
:
mod
=
Mod1Mask
;
mod
|
=
Mod1Mask
;
break
;
case
'4'
:
mod
=
Mod4Mask
;
mod
|
=
Mod4Mask
;
break
;
default:
weprintf
(
"keys: invalid modifier %c in %s"
,
ks
[
0
],
ks
);
weprintf
(
"keys: invalid modifier %c in %s"
,
cur
[
0
],
ks
);
break
;
}
cur
=
ks
+
2
;
cur
+
=
2
;
}
key
->
keysyms
[
index
]
=
XStringToKeysym
(
cur
);
...
...
@@ -97,6 +97,10 @@ void init_keyevents(void) {
feh_set_kb
(
&
keys
.
scroll_right
,
0
,
XK_KP_Right
,
4
,
XK_Right
,
0
,
0
);
feh_set_kb
(
&
keys
.
scroll_down
,
0
,
XK_KP_Down
,
4
,
XK_Down
,
0
,
0
);
feh_set_kb
(
&
keys
.
scroll_up
,
0
,
XK_KP_Up
,
4
,
XK_Up
,
0
,
0
);
feh_set_kb
(
&
keys
.
scroll_left_page
,
8
,
XK_Left
,
0
,
0
,
0
,
0
);
feh_set_kb
(
&
keys
.
scroll_right_page
,
8
,
XK_Right
,
0
,
0
,
0
,
0
);
feh_set_kb
(
&
keys
.
scroll_down_page
,
8
,
XK_Down
,
0
,
0
,
0
,
0
);
feh_set_kb
(
&
keys
.
scroll_up_page
,
8
,
XK_Up
,
0
,
0
,
0
,
0
);
feh_set_kb
(
&
keys
.
prev_img
,
0
,
XK_Left
,
0
,
XK_p
,
0
,
XK_BackSpace
);
feh_set_kb
(
&
keys
.
next_img
,
0
,
XK_Right
,
0
,
XK_n
,
0
,
XK_space
);
feh_set_kb
(
&
keys
.
jump_back
,
0
,
XK_Page_Up
,
0
,
XK_KP_Page_Up
,
0
,
0
);
...
...
@@ -191,6 +195,14 @@ void init_keyevents(void) {
cur_kb
=
&
keys
.
scroll_up
;
else
if
(
!
strcmp
(
action
,
"scroll_down"
))
cur_kb
=
&
keys
.
scroll_down
;
else
if
(
!
strcmp
(
action
,
"scroll_right_page"
))
cur_kb
=
&
keys
.
scroll_right_page
;
else
if
(
!
strcmp
(
action
,
"scroll_left_page"
))
cur_kb
=
&
keys
.
scroll_left_page
;
else
if
(
!
strcmp
(
action
,
"scroll_up_page"
))
cur_kb
=
&
keys
.
scroll_up_page
;
else
if
(
!
strcmp
(
action
,
"scroll_down_page"
))
cur_kb
=
&
keys
.
scroll_down_page
;
else
if
(
!
strcmp
(
action
,
"prev_img"
))
cur_kb
=
&
keys
.
prev_img
;
else
if
(
!
strcmp
(
action
,
"next_img"
))
...
...
@@ -449,6 +461,22 @@ void feh_event_handle_keypress(XEvent * ev)
winwid
->
im_y
+=
20
;
winwidget_render_image
(
winwid
,
0
,
1
);
}
else
if
(
feh_is_kp
(
&
keys
.
scroll_right_page
,
keysym
,
state
))
{
winwid
->
im_x
-=
winwid
->
w
;
winwidget_render_image
(
winwid
,
0
,
1
);
}
else
if
(
feh_is_kp
(
&
keys
.
scroll_left_page
,
keysym
,
state
))
{
winwid
->
im_x
+=
winwid
->
w
;
winwidget_render_image
(
winwid
,
0
,
1
);
}
else
if
(
feh_is_kp
(
&
keys
.
scroll_down_page
,
keysym
,
state
))
{
winwid
->
im_y
-=
winwid
->
h
;
winwidget_render_image
(
winwid
,
0
,
1
);
}
else
if
(
feh_is_kp
(
&
keys
.
scroll_up_page
,
keysym
,
state
))
{
winwid
->
im_y
+=
winwid
->
h
;
winwidget_render_image
(
winwid
,
0
,
1
);
}
else
if
(
feh_is_kp
(
&
keys
.
jump_back
,
keysym
,
state
))
{
if
(
opt
.
slideshow
)
slideshow_change_image
(
winwid
,
SLIDE_JUMP_BACK
);
...
...
This diff is collapsed.
Click to expand it.
src/options.h
+
4
−
0
View file @
c4e8591b
...
...
@@ -152,6 +152,10 @@ struct __fehkb {
struct
__fehkey
next_img
;
struct
__fehkey
scroll_up
;
struct
__fehkey
scroll_down
;
struct
__fehkey
scroll_right_page
;
struct
__fehkey
scroll_left_page
;
struct
__fehkey
scroll_up_page
;
struct
__fehkey
scroll_down_page
;
struct
__fehkey
jump_back
;
struct
__fehkey
quit
;
struct
__fehkey
jump_fwd
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment