summaryrefslogtreecommitdiffstats
path: root/pdf
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2014-09-26 14:15:50 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-26 21:16:24 +0000
commit48fa9730d36a831e0f0d950328959d6e20dc1a83 (patch)
treebd9dfb25d98c8e34666c017fdd0d32933dd99b47 /pdf
parent49264e03b28ad3813382bef032839eddf893fa7e (diff)
downloadchromium_src-48fa9730d36a831e0f0d950328959d6e20dc1a83.zip
chromium_src-48fa9730d36a831e0f0d950328959d6e20dc1a83.tar.gz
chromium_src-48fa9730d36a831e0f0d950328959d6e20dc1a83.tar.bz2
PDF: Change the rotate shortcut keys to ctrl+[] on all platforms.
The default modifier key on Mac is Command, but that conflicts with the forward and backward keys. BUG=111232,417902 Review URL: https://codereview.chromium.org/606933002 Cr-Commit-Position: refs/heads/master@{#297033}
Diffstat (limited to 'pdf')
-rw-r--r--pdf/instance.cc33
1 files changed, 19 insertions, 14 deletions
diff --git a/pdf/instance.cc b/pdf/instance.cc
index 6a68400..a71d071 100644
--- a/pdf/instance.cc
+++ b/pdf/instance.cc
@@ -587,21 +587,26 @@ bool Instance::HandleInputEvent(const pp::InputEvent& event) {
}
}
- if (event.GetType() == PP_INPUTEVENT_TYPE_KEYDOWN &&
- event.GetModifiers() & kDefaultKeyModifier) {
+ if (event.GetType() == PP_INPUTEVENT_TYPE_KEYDOWN) {
pp::KeyboardInputEvent keyboard_event(event);
- switch (keyboard_event.GetKeyCode()) {
- case 'A':
- engine_->SelectAll();
- return true;
- case ui::VKEY_OEM_4:
- // Left bracket.
- engine_->RotateCounterclockwise();
- return true;
- case ui::VKEY_OEM_6:
- // Right bracket.
- engine_->RotateClockwise();
- return true;
+ const uint32 modifier = event.GetModifiers();
+ if (modifier & kDefaultKeyModifier) {
+ switch (keyboard_event.GetKeyCode()) {
+ case 'A':
+ engine_->SelectAll();
+ return true;
+ }
+ } else if (modifier & PP_INPUTEVENT_MODIFIER_CONTROLKEY) {
+ switch (keyboard_event.GetKeyCode()) {
+ case ui::VKEY_OEM_4:
+ // Left bracket.
+ engine_->RotateCounterclockwise();
+ return true;
+ case ui::VKEY_OEM_6:
+ // Right bracket.
+ engine_->RotateClockwise();
+ return true;
+ }
}
}