Skip to content

Commit

Permalink
Fix OSX alt behaviour.
Browse files Browse the repository at this point in the history
  • Loading branch information
Swordfish90 committed Jan 4, 2015
1 parent b03e96e commit 4b3fd27
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Vt102Emulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,15 +931,18 @@ void Vt102Emulation::sendKeyEvent( QKeyEvent* event )
// Alt+[Character] results in Esc+[Character] being sent
// (unless there is an entry defined for this particular combination
// in the keyboard modifier)

#if !defined(Q_OS_MAC)
bool wantsAltModifier = entry.modifiers() & entry.modifierMask() & Qt::AltModifier;
bool wantsAnyModifier = entry.state() &
bool wantsAnyModifier = entry.state() &
entry.stateMask() & KeyboardTranslator::AnyModifierState;

if ( modifiers & Qt::AltModifier && !(wantsAltModifier || wantsAnyModifier)
if ( modifiers & Qt::AltModifier && !(wantsAltModifier || wantsAnyModifier)
&& !event->text().isEmpty() )
{
textToSend.prepend("\033");
}
#endif

if ( entry.command() != KeyboardTranslator::NoCommand )
{
Expand Down

0 comments on commit 4b3fd27

Please sign in to comment.