示例#1
0
        void OnInputKeyPressEvent(EventKey evnt)
        {
            if (im_context.FilterKeypress(evnt) || ((evnt.State & ModifierType.ControlMask) != 0))
            {
                return;
            }

            char c;

            if (evnt.Key == Key.Return)
            {
                c = '\n';
            }
            else
            {
                c = (char)Keyval.ToUnicode(evnt.KeyValue);
            }
            if (char.IsLetterOrDigit(c) ||
                char.IsPunctuation(c) ||
                c == '\n' ||
                (c == ' ' && SearchController.Query.Length > 0) ||
                char.IsSymbol(c))
            {
                SearchController.AddChar(c);
            }
        }
示例#2
0
 void OnIMCommit(object sender, Gtk.CommitArgs e)
 {
     foreach (char c in e.Str)
     {
         SearchController.AddChar(c);
     }
 }