views: Make auto-hide-menu-bar work when NumLock is on, fixes #796
This commit is contained in:
parent
ef255db069
commit
b92d5071fa
1 changed files with 6 additions and 3 deletions
|
@ -113,9 +113,12 @@ bool IsAltKey(const content::NativeWebKeyboardEvent& event) {
|
|||
|
||||
bool IsAltModifier(const content::NativeWebKeyboardEvent& event) {
|
||||
typedef content::NativeWebKeyboardEvent::Modifiers Modifiers;
|
||||
return (event.modifiers == Modifiers::AltKey) ||
|
||||
(event.modifiers == (Modifiers::AltKey | Modifiers::IsLeft)) ||
|
||||
(event.modifiers == (Modifiers::AltKey | Modifiers::IsRight));
|
||||
int modifiers = event.modifiers;
|
||||
modifiers &= ~Modifiers::NumLockOn;
|
||||
modifiers &= ~Modifiers::CapsLockOn;
|
||||
return (modifiers == Modifiers::AltKey) ||
|
||||
(modifiers == (Modifiers::AltKey | Modifiers::IsLeft)) ||
|
||||
(modifiers == (Modifiers::AltKey | Modifiers::IsRight));
|
||||
}
|
||||
|
||||
class NativeWindowClientView : public views::ClientView {
|
||||
|
|
Loading…
Reference in a new issue