Beispiel #1
0
        public WinFormsEdit(GUIObject guiobject)
        {
            Init(new WF.TextBox(), guiobject);

            //TODO: make possible to change the typed key!

            TextBox.KeyDown += (s, e) => {
                var be = new KeyEventArgs(WinFormsKeys.DecodeKey(e.KeyCode));
                ((Edit)Widget).TriggerKeyDown(be);
                e.SuppressKeyPress = be.Block;
            };
        }
Beispiel #2
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            //we use this raw function catch tab key down etc
            KeyData kcode = WinFormsKeys.DecodeKey(keyData);

            if (kcode.KeyCode == KeyCode.Unknown)
            {
                return(base.ProcessCmdKey(ref msg, keyData)); //dont send events for unknown keys
            }
            char oldchar = kcode.Char;                        //remember to check if user changed key stroke  TODO: does this work?


            KeyEventArgs ke = new KeyEventArgs(kcode);

            ((Window)shellobject).TriggerKeyPreview(ke);
            if (ke.Block)
            {
                return(true);          //goodbye event
            }
            return(base.ProcessCmdKey(ref msg, keyData));
        }