Fix Ctrl+A/C/V/X on RGB/HSV text fields

This commit is contained in:
David Capello 2016-11-22 10:34:00 -03:00
parent b2a25954d4
commit a67589aa05
3 changed files with 31 additions and 25 deletions

View File

@ -125,30 +125,30 @@ namespace she {
kKeyCircumflex = 100,
kKeyColon2 = 101,
kKeyKanji = 102,
kKeyEqualsPad = 103, // MacOS X
kKeyBackquote = 104, // MacOS X
kKeySemicolon = 105, // MacOS X
kKeyCommand = 106, // MacOS X
kKeyUnknown1 = 107,
kKeyUnknown2 = 108,
kKeyUnknown3 = 109,
kKeyUnknown4 = 110,
kKeyUnknown5 = 111,
kKeyUnknown6 = 112,
kKeyUnknown7 = 113,
kKeyUnknown8 = 114,
kKeyEqualsPad = 103, // macOS
kKeyBackquote = 104, // macOS
kKeySemicolon = 105, // macOS
kKeyUnknown1 = 106,
kKeyUnknown2 = 107,
kKeyUnknown3 = 108,
kKeyUnknown4 = 109,
kKeyUnknown5 = 110,
kKeyUnknown6 = 111,
kKeyUnknown7 = 112,
kKeyUnknown8 = 113,
kKeyFirstModifierScancode = 115,
kKeyFirstModifierScancode = 114,
kKeyLShift = 115,
kKeyRShift = 116,
kKeyLControl = 117,
kKeyRControl = 118,
kKeyAlt = 119,
kKeyAltGr = 120,
kKeyLWin = 121,
kKeyRWin = 122,
kKeyMenu = 123,
kKeyLShift = 114,
kKeyRShift = 115,
kKeyLControl = 116,
kKeyRControl = 117,
kKeyAlt = 118,
kKeyAltGr = 119,
kKeyLWin = 120,
kKeyRWin = 121,
kKeyMenu = 122,
kKeyCommand = 123, // macOS - TODO This should be inside the modifiers range
kKeyScrLock = 124,
kKeyNumLock = 125,
kKeyCapsLock = 126,

View File

@ -300,7 +300,7 @@ bool Entry::onProcessMessage(Message* msg)
break;
default:
// Map common Windows shortcuts for Cut/Copy/Paste
// Map common macOS/Windows shortcuts for Cut/Copy/Paste/Select all
#if defined __APPLE__
if (msg->onlyCmdPressed())
#else
@ -328,6 +328,12 @@ bool Entry::onProcessMessage(Message* msg)
}
return true;
}
// Consume all key down of modifiers only, e.g. so the user
// can press first "Ctrl" key, and then "Ctrl+C"
// combination.
else if (keymsg->scancode() >= kKeyFirstModifierScancode) {
return true;
}
else {
break; // Propagate to manager
}

View File

@ -1,5 +1,5 @@
// Aseprite UI Library
// Copyright (C) 2001-2015 David Capello
// Copyright (C) 2001-2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
@ -130,7 +130,6 @@ namespace ui {
using she::kKeyEqualsPad;
using she::kKeyBackquote;
using she::kKeySemicolon;
using she::kKeyCommand;
using she::kKeyUnknown1;
using she::kKeyUnknown2;
using she::kKeyUnknown3;
@ -151,6 +150,7 @@ namespace ui {
using she::kKeyLWin;
using she::kKeyRWin;
using she::kKeyMenu;
using she::kKeyCommand;
using she::kKeyScrLock;
using she::kKeyNumLock;
using she::kKeyCapsLock;