D23472: Enable typing soft-hyphen characters

Christoph Cullmann noreply at phabricator.kde.org
Mon Aug 26 20:31:08 BST 2019


cullmann added a comment.


  I checked a bit what Qt does:
  
  bool QInputControl::isAcceptableInput(const QKeyEvent *event) const
  {
  
    const QString text = event->text();
    if (text.isEmpty())
        return false;
    
    const QChar c = text.at(0);
    
    // Formatting characters such as ZWNJ, ZWJ, RLM, etc. This needs to go before the
    // next test, since CTRL+SHIFT is sometimes used to input it on Windows.
    if (c.category() == QChar::Other_Format)
        return true;
    
    // QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards
    if (event->modifiers() == Qt::ControlModifier
            || event->modifiers() == (Qt::ShiftModifier | Qt::ControlModifier)) {
        return false;
    }
    
    if (c.isPrint())
        return true;
    
    if (c.category() == QChar::Other_PrivateUse)
        return true;
    
    if (m_type == TextEdit && c == QLatin1Char('\t'))
        return true;
    
    return false;
  
  }
  
  is applied on key events.

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D23472

To: ahmadsamir, #ktexteditor, dhaumann, cullmann
Cc: kde-frameworks-devel, kwrite-devel, LeGast00n, GB_2, domson, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190826/b5334d16/attachment.html>


More information about the Kde-frameworks-devel mailing list