|
|
|
@ -495,8 +495,9 @@ int Sym::qt() const
|
|
|
|
|
|
|
|
|
|
TQString Sym::toString( bool bUserSpace ) const
|
|
|
|
|
{
|
|
|
|
|
if( m_sym == 0 )
|
|
|
|
|
if( m_sym == 0 ) {
|
|
|
|
|
return TQString::null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If it's a unicode character,
|
|
|
|
|
#ifdef Q_WS_WIN
|
|
|
|
@ -508,15 +509,17 @@ TQString Sym::toString( bool bUserSpace ) const
|
|
|
|
|
// Print all non-space characters directly when output is user-visible.
|
|
|
|
|
// Otherwise only print alphanumeric latin1 characters directly (A,B,C,1,2,3).
|
|
|
|
|
if( (c.latin1() && c.isLetterOrNumber())
|
|
|
|
|
|| (bUserSpace && !c.isSpace()) )
|
|
|
|
|
|| (bUserSpace && !c.isSpace()) ) {
|
|
|
|
|
return c;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Look up in special names list
|
|
|
|
|
for( int i = 0; g_rgSymNames[i].sym != 0; i++ ) {
|
|
|
|
|
if( m_sym == g_rgSymNames[i].sym )
|
|
|
|
|
if( m_sym == g_rgSymNames[i].sym ) {
|
|
|
|
|
return bUserSpace ? i18n(g_rgSymNames[i].psName) : TQString(g_rgSymNames[i].psName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQString s;
|
|
|
|
|
#ifdef Q_WS_WIN
|
|
|
|
@ -995,9 +998,10 @@ void Variations::init( const KKey& key, bool bQt )
|
|
|
|
|
uint nVariations = 0;
|
|
|
|
|
for( uint i = 0; i < m_nVariations; i++ ) {
|
|
|
|
|
int keyQt = KKeyNative( m_rgkey[i].code(), m_rgkey[i].mod(), m_rgkey[i].sym() ).keyCodeQt();
|
|
|
|
|
if( keyQt )
|
|
|
|
|
if( keyQt ) {
|
|
|
|
|
m_rgkey[nVariations++].setKeycodeQt( keyQt );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
m_nVariations = nVariations;
|
|
|
|
|
|
|
|
|
|
// Two different native codes may produce a single
|
|
|
|
@ -1006,8 +1010,9 @@ void Variations::init( const KKey& key, bool bQt )
|
|
|
|
|
for( uint j = 0; j < i; j++ ) {
|
|
|
|
|
// If key is already present in list, then remove it.
|
|
|
|
|
if( m_rgkey[i].keyCodeQt() == m_rgkey[j].keyCodeQt() ) {
|
|
|
|
|
for( uint k = i; k < m_nVariations - 1; k++ )
|
|
|
|
|
for( uint k = i; k < m_nVariations - 1; k++ ) {
|
|
|
|
|
m_rgkey[k].setKeycodeQt( m_rgkey[k+1].keyCodeQt() );
|
|
|
|
|
}
|
|
|
|
|
m_nVariations--;
|
|
|
|
|
i--;
|
|
|
|
|
break;
|
|
|
|
@ -1040,8 +1045,9 @@ void KKey::simplify()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If this is a letter, don't remove any modifiers.
|
|
|
|
|
if( m_sym < 0x3000 && TQChar(m_sym).isLetter() )
|
|
|
|
|
if( m_sym < 0x3000 && TQChar(m_sym).isLetter() ) {
|
|
|
|
|
m_sym = TQChar(m_sym).lower().unicode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Remove modifers from modifier list which are implicit in the symbol.
|
|
|
|
|
// Ex. Shift+Plus => Plus (en)
|
|
|
|
|