Bug 216809

Summary: Key Bindings make incorrect output
Product: [Applications] konsole Reporter: shevtsov
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED NOT A BUG    
Severity: normal CC: adaptee
Priority: NOR    
Version: 2.3.3   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description shevtsov 2009-11-30 14:39:43 UTC
Version:           2.3.3 (using 4.3.3 (KDE 4.3.3), 4.3.3-4.fc12 Fedora)
Compiler:          gcc
OS:                Linux (i686) release 2.6.31.5-127.fc12.i686.PAE

I have a task to implement a SCO Console mode (http://vt100.net/docs/vt510-rm/chapter6)
So, a new key binding list was created, and one line of .keytab is:
key PgDown+Ctrl : "\E[*"
But while pushing Ctrl+PgDown in Test Area, we got a next result:
Input:  PgDown+Ctrl
Output: \E[5
"*" is changed by "5"
Comment 1 Jekyll Wu 2011-11-02 00:51:26 UTC
I do not fully understand that part of code, but it seems an intentional behavior, instead of a bug.

inline QByteArray KeyboardTranslator::Entry::text(bool expandWildCards,Qt::KeyboardModifiers modifiers) const 
{
    QByteArray expandedText = _text;
    
    if (expandWildCards)
    {
        int modifierValue = 1;
        modifierValue += oneOrZero(modifiers & Qt::ShiftModifier);
        modifierValue += oneOrZero(modifiers & Qt::AltModifier)     << 1;
        modifierValue += oneOrZero(modifiers & Qt::ControlModifier) << 2;

        for (int i=0;i<_text.length();i++) 
        {
            if (expandedText[i] == '*')
                expandedText[i] = '0' + modifierValue;
        }
    }

    return expandedText; 
}