Esempio n. 1
0
 bool HandleKeyEvent(QKeyEvent kevent)
 {
     if (kevent.Key() == (int)Qt.Key.Key_Return || kevent.Key() == (int)Qt.Key.Key_Enter)
     {
         if ((kevent.Modifiers() & (uint)Qt.KeyboardModifier.ControlModifier) == 0)
         {
             string html = textEdit.ToHtml();
             if (m_Handler is ChatHandler)
             {
                 string resource = m_ToComboBox.ItemData(m_ToComboBox.CurrentIndex);
                 ((ChatHandler)m_Handler).Resource = (resource == "auto") ? null : resource;
             }
             m_Handler.Send(html);
             textEdit.Clear();
         }
         else
         {
             textEdit.TextCursor().InsertText("\n");
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 2
0
 protected override void KeyPressEvent(QKeyEvent e)
 {
     Debug.Log(e.Key());
 }