Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fc-pregmod
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pregmodfan
fc-pregmod
Commits
98b1a63d
Commit
98b1a63d
authored
4 years ago
by
svornost
Browse files
Options
Downloads
Patches
Plain Diff
FCHost - map Ctrl+Plus and Ctrl+Minus keybinds to zoom in and out.
parent
e1fd8409
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!8361
FCHost - map Ctrl+Plus and Ctrl+Minus keybinds to zoom in and out.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
FCHost/fchost/fchost_handler.cc
+24
-4
24 additions, 4 deletions
FCHost/fchost/fchost_handler.cc
with
24 additions
and
4 deletions
FCHost/fchost/fchost_handler.cc
+
24
−
4
View file @
98b1a63d
...
...
@@ -190,10 +190,18 @@ bool FCHostHandler::OnPreKeyEvent(CefRefPtr<CefBrowser> browser,
{
CEF_REQUIRE_UI_THREAD
();
if
(
event
.
type
==
cef_key_event_type_t
::
KEYEVENT_CHAR
)
// for nonwindows platforms, we need to know the windows equivalent keycode, because CEF will convert to them for us
const
int
key_f
=
0x46
;
const
int
key_j
=
0x4A
;
const
int
key_plus
=
0xBB
;
const
int
key_numpad_plus
=
0x6B
;
const
int
key_minus
=
0xBD
;
const
int
key_numpad_minus
=
0x6D
;
if
(
event
.
type
==
cef_key_event_type_t
::
KEYEVENT_RAWKEYDOWN
)
{
// CTRL+SHIFT+J - bring up the Javascript debugger
if
((
event
.
modifiers
==
(
cef_event_flags_t
::
EVENTFLAG_CONTROL_DOWN
|
cef_event_flags_t
::
EVENTFLAG_SHIFT_DOWN
))
&&
event
.
unmodified_character
==
10
/* j? maybe only on windows? whatever */
)
if
((
event
.
modifiers
==
(
cef_event_flags_t
::
EVENTFLAG_CONTROL_DOWN
|
cef_event_flags_t
::
EVENTFLAG_SHIFT_DOWN
))
&&
event
.
windows_key_code
==
key_j
)
{
CefWindowInfo
windowInfo
;
CefBrowserSettings
settings
;
...
...
@@ -204,12 +212,24 @@ bool FCHostHandler::OnPreKeyEvent(CefRefPtr<CefBrowser> browser,
return
true
;
}
// CTRL+F - bring up Find In Page
else
if
(
event
.
modifiers
==
cef_event_flags_t
::
EVENTFLAG_CONTROL_DOWN
&&
event
.
unmodified_character
==
6
/* f? maybe only on windows? whatever */
)
else
if
(
event
.
modifiers
==
cef_event_flags_t
::
EVENTFLAG_CONTROL_DOWN
&&
event
.
windows_key_code
==
key_f
)
{
// probably can do this at some point by ripping off code from the full-fat cefclient, but damn there's a lot of it...
// return true;
}
}
// CTRL++ - zoom in
else
if
(
event
.
modifiers
==
cef_event_flags_t
::
EVENTFLAG_CONTROL_DOWN
&&
(
event
.
windows_key_code
==
key_plus
||
event
.
windows_key_code
==
key_numpad_plus
))
{
double
curZoom
=
browser
->
GetHost
()
->
GetZoomLevel
();
browser
->
GetHost
()
->
SetZoomLevel
(
curZoom
+
1.0
);
}
// CTRL+- - zoom out
else
if
(
event
.
modifiers
==
cef_event_flags_t
::
EVENTFLAG_CONTROL_DOWN
&&
(
event
.
windows_key_code
==
key_minus
||
event
.
windows_key_code
==
key_numpad_minus
))
{
double
curZoom
=
browser
->
GetHost
()
->
GetZoomLevel
();
browser
->
GetHost
()
->
SetZoomLevel
(
curZoom
-
1.0
);
}
}
return
false
;
}
...
...
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