Ejemplo 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);
     }
 }
Ejemplo n.º 2
0
 protected virtual void KeyReleaseEvent(QKeyEvent e)
 {
 }
Ejemplo n.º 3
0
 protected virtual void KeyPressEvent(QKeyEvent e)
 {
 }
Ejemplo n.º 4
0
 protected override void KeyReleaseEvent(QKeyEvent e)
 {
     Debug.Log((e.Modifiers() & EventModifiers.Shift) != 0);
 }
Ejemplo n.º 5
0
 protected override void KeyPressEvent(QKeyEvent e)
 {
     Debug.Log(e.Key());
 }