Add common keys in ui::Entry for OS X

This commit is contained in:
David Capello 2015-05-11 12:12:13 -03:00
parent 7450139898
commit 02d163b8d8

View File

@ -226,15 +226,19 @@ bool Entry::onProcessMessage(Message* msg)
switch (scancode) { switch (scancode) {
case kKeyLeft: case kKeyLeft:
if (msg->ctrlPressed()) if (msg->ctrlPressed() || msg->altPressed())
cmd = EntryCmd::BackwardWord; cmd = EntryCmd::BackwardWord;
else if (msg->cmdPressed())
cmd = EntryCmd::BeginningOfLine;
else else
cmd = EntryCmd::BackwardChar; cmd = EntryCmd::BackwardChar;
break; break;
case kKeyRight: case kKeyRight:
if (msg->ctrlPressed()) if (msg->ctrlPressed() || msg->altPressed())
cmd = EntryCmd::ForwardWord; cmd = EntryCmd::ForwardWord;
else if (msg->cmdPressed())
cmd = EntryCmd::EndOfLine;
else else
cmd = EntryCmd::ForwardChar; cmd = EntryCmd::ForwardChar;
break; break;