Example #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);
     }
 }
Example #2
0
 protected override void KeyReleaseEvent(QKeyEvent e)
 {
     Debug.Log((e.Modifiers() & EventModifiers.Shift) != 0);
 }