Commit 48fa9730 authored by thestig's avatar thestig Committed by Commit bot

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}
parent 49264e03
...@@ -235,14 +235,18 @@ PDFViewer.prototype = { ...@@ -235,14 +235,18 @@ PDFViewer.prototype = {
} }
return; return;
case 219: // left bracket. case 219: // left bracket.
this.plugin_.postMessage({ if (e.ctrlKey) {
type: 'rotateCounterclockwise', this.plugin_.postMessage({
}); type: 'rotateCounterclockwise',
});
}
return; return;
case 221: // right bracket. case 221: // right bracket.
this.plugin_.postMessage({ if (e.ctrlKey) {
type: 'rotateClockwise', this.plugin_.postMessage({
}); type: 'rotateClockwise',
});
}
return; return;
} }
}, },
......
...@@ -587,21 +587,26 @@ bool Instance::HandleInputEvent(const pp::InputEvent& event) { ...@@ -587,21 +587,26 @@ bool Instance::HandleInputEvent(const pp::InputEvent& event) {
} }
} }
if (event.GetType() == PP_INPUTEVENT_TYPE_KEYDOWN && if (event.GetType() == PP_INPUTEVENT_TYPE_KEYDOWN) {
event.GetModifiers() & kDefaultKeyModifier) {
pp::KeyboardInputEvent keyboard_event(event); pp::KeyboardInputEvent keyboard_event(event);
switch (keyboard_event.GetKeyCode()) { const uint32 modifier = event.GetModifiers();
case 'A': if (modifier & kDefaultKeyModifier) {
engine_->SelectAll(); switch (keyboard_event.GetKeyCode()) {
return true; case 'A':
case ui::VKEY_OEM_4: engine_->SelectAll();
// Left bracket. return true;
engine_->RotateCounterclockwise(); }
return true; } else if (modifier & PP_INPUTEVENT_MODIFIER_CONTROLKEY) {
case ui::VKEY_OEM_6: switch (keyboard_event.GetKeyCode()) {
// Right bracket. case ui::VKEY_OEM_4:
engine_->RotateClockwise(); // Left bracket.
return true; engine_->RotateCounterclockwise();
return true;
case ui::VKEY_OEM_6:
// Right bracket.
engine_->RotateClockwise();
return true;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment