update keyboard shortcuts
This commit is contained in:
@@ -583,27 +583,29 @@ std::optional<ShipLayoutConfig> ShipLayoutDialog::result() const
|
||||
|
||||
void ShipLayoutDialog::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
if (event->key() == Qt::Key_Q)
|
||||
if (event->key() == Qt::Key_R)
|
||||
{
|
||||
// Rotate CCW = 3 CW steps.
|
||||
switch (m_currentRotation)
|
||||
if (event->modifiers() & Qt::ShiftModifier)
|
||||
{
|
||||
case Rotation::East: m_currentRotation = Rotation::North; break;
|
||||
case Rotation::North: m_currentRotation = Rotation::West; break;
|
||||
case Rotation::West: m_currentRotation = Rotation::South; break;
|
||||
case Rotation::South: m_currentRotation = Rotation::East; break;
|
||||
// Shift+R: rotate CW.
|
||||
switch (m_currentRotation)
|
||||
{
|
||||
case Rotation::East: m_currentRotation = Rotation::South; break;
|
||||
case Rotation::South: m_currentRotation = Rotation::West; break;
|
||||
case Rotation::West: m_currentRotation = Rotation::North; break;
|
||||
case Rotation::North: m_currentRotation = Rotation::East; break;
|
||||
}
|
||||
}
|
||||
updateGridWidget();
|
||||
}
|
||||
else if (event->key() == Qt::Key_E)
|
||||
{
|
||||
// Rotate CW.
|
||||
switch (m_currentRotation)
|
||||
else
|
||||
{
|
||||
case Rotation::East: m_currentRotation = Rotation::South; break;
|
||||
case Rotation::South: m_currentRotation = Rotation::West; break;
|
||||
case Rotation::West: m_currentRotation = Rotation::North; break;
|
||||
case Rotation::North: m_currentRotation = Rotation::East; break;
|
||||
// R: rotate CCW.
|
||||
switch (m_currentRotation)
|
||||
{
|
||||
case Rotation::East: m_currentRotation = Rotation::North; break;
|
||||
case Rotation::North: m_currentRotation = Rotation::West; break;
|
||||
case Rotation::West: m_currentRotation = Rotation::South; break;
|
||||
case Rotation::South: m_currentRotation = Rotation::East; break;
|
||||
}
|
||||
}
|
||||
updateGridWidget();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user