Added a few more editing shortcuts, fixed a few warnings, and re-applied reverted commit.

This commit is contained in:
Stephen Anthony 2020-11-06 19:38:02 -03:30
parent 6b46f85fc9
commit 3dfa06c888
4 changed files with 8 additions and 5 deletions

View File

@ -165,7 +165,7 @@ void PhysicalKeyboardHandler::setDefaultMapping(Event::Type event, EventMode mod
case EventMode::kEditMode:
// Edit mode events are always set because they are not saved
for(const auto& item : FixedEditMapping)
for(const auto& item: FixedEditMapping)
setDefaultKey(item, event, EventMode::kEditMode);
break;
@ -661,7 +661,6 @@ PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::DefaultMenuM
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::FixedEditMapping = {
// TOOD: check MacOS mappings
{Event::MoveLeftChar, KBDK_LEFT},
{Event::MoveRightChar, KBDK_RIGHT},
{Event::SelectLeftChar, KBDK_LEFT, KBDM_SHIFT},
@ -687,7 +686,7 @@ PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::FixedEditMap
{Event::Delete, KBDK_DELETE},
{Event::DeleteChar, KBDK_D, KBDM_CTRL},
{Event::DeleteWord, KBDK_W, KBDM_CTRL},
{Event::DeleteWord, KBDK_BACKSPACE, KBDM_CTRL},
{Event::DeleteWord, KBDK_BACKSPACE, OPTION},
{Event::DeleteHome, KBDK_U, KBDM_CTRL},
{Event::DeleteHome, KBDK_BACKSPACE, CMD},
{Event::DeleteEnd, KBDK_K, KBDM_CTRL},
@ -711,8 +710,11 @@ PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::FixedEditMap
{Event::Delete, KBDK_DELETE},
{Event::Delete, KBDK_KP_PERIOD},
{Event::DeleteChar, KBDK_D, KBDM_CTRL},
{Event::DeleteWord, KBDK_BACKSPACE, KBDM_CTRL},
{Event::DeleteWord, KBDK_W, KBDM_CTRL},
{Event::DeleteHome, KBDK_HOME, KBDM_CTRL},
{Event::DeleteHome, KBDK_U, KBDM_CTRL},
{Event::DeleteEnd, KBDK_END, KBDM_CTRL},
{Event::DeleteEnd, KBDK_K, KBDM_CTRL},
{Event::Backspace, KBDK_BACKSPACE},
{Event::Undo, KBDK_Z, KBDM_CTRL},

View File

@ -106,6 +106,7 @@ class PhysicalKeyboardHandler
void enableMappings(const Event::EventSet& events, EventMode mode);
void enableMapping(const Event::Type event, EventMode mode);
private:
OSystem& myOSystem;
EventHandler& myHandler;

View File

@ -62,6 +62,7 @@ void EditableWidget::setText(const string& str, bool)
setDirty();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EditableWidget::setEditable(bool editable, bool hiliteBG)
{
@ -608,7 +609,6 @@ int EditableWidget::selectEndPos()
return _caretPos;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool EditableWidget::killSelectedText(bool addEdit)
{

View File

@ -103,4 +103,4 @@ uInt32 UndoHandler::lastDiff(const string& text, const string& oldText) const
pos--;
}
return uInt32(pos);
}
}