Hide or disable WIN and ALT keys on radVirtualKeyboard

2 Answers 135 Views
VirtualKeyboard
Chris
Top achievements
Rank 2
Iron
Chris asked on 25 Jan 2023, 05:51 PM | edited on 25 Jan 2023, 05:53 PM

Hi,

How do I hide or disable WIN and ALT keys on  a radVirtualKeyboard?

I'm using the Simplified keybordlayout.

 

Chris.

 

 

 

2 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Jan 2023, 05:47 AM

Hello, Chris,

The following help article demonstrates a sample approach how to access the logical layouts and the virtual keys and then hide those of them that are not needed:

https://docs.telerik.com/devtools/winforms/controls/virtual-keyboard/logical-keyboard-layout 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Chris
Top achievements
Rank 2
Iron
commented on 26 Jan 2023, 07:34 AM

Thank you very much!


Regards,

Chris.

0
Chris
Top achievements
Rank 2
Iron
answered on 26 Jan 2023, 12:18 PM

 

Hi Dess,

I tried this code , but it does not work with LWIN, RWIN or ALT keys.

row returns null.

var allKeys = this.radVirtualKeyboard1.MainLayoutPanel.GetAllKeys();
Key Qkey = allKeys.FirstOrDefault(k => k.VirtualKey == (int)Keys.LWin) as Key;
Row row = this.radVirtualKeyboard1.MainLayoutPanel.FindRowByKey(Qkey);
row.Keys.Remove(Qkey);
this.radVirtualKeyboard1.MainLayoutPanel.ResetLayout(true);

Dess | Tech Support Engineer, Principal
Telerik team
commented on 27 Jan 2023, 09:27 AM

Chris,

Note that the key you are trying to remove is a ToggleKey, not Key:

I have modified the code as below and the key is successfully removed from the layout:

            var allKeys = this.radVirtualKeyboard1.MainLayoutPanel.GetAllKeys();
            ToggleKey Qkey = allKeys.FirstOrDefault(k => k.VirtualKey == (int)Keys.LWin) as ToggleKey;
            Row row = this.radVirtualKeyboard1.MainLayoutPanel.FindRowByKey(Qkey);
            row.Keys.Remove(Qkey);
            this.radVirtualKeyboard1.MainLayoutPanel.ResetLayout(true);

Chris
Top achievements
Rank 2
Iron
commented on 29 Jan 2023, 06:21 PM

Hi Dess,

This works fine with LWin and RWin keys, but does not work with the ALT keys, how can I remove those?

Regards,

Chris.

 

Dess | Tech Support Engineer, Principal
Telerik team
commented on 30 Jan 2023, 01:10 PM

Hi, Chris,

I have prepared a sample code snippet demonstrating how to hide the Alt key at the bottom left side:

        public RadForm1()
        {
            InitializeComponent();

            var allKeys = this.radVirtualKeyboard1.MainLayoutPanel.GetAllKeys();
            IKey Qkey = allKeys.FirstOrDefault(k => k.VirtualKey == (int)Keys.LMenu) as IKey;
            Row row = this.radVirtualKeyboard1.MainLayoutPanel.FindRowByKey(Qkey);
            row.Keys.Remove(Qkey);
            this.radVirtualKeyboard1.MainLayoutPanel.ResetLayout(true);
        }

Chris
Top achievements
Rank 2
Iron
commented on 30 Jan 2023, 02:34 PM

Hi Dess,

Thanks for your support, this works perfect.

Regards, Chris.

 

Tags
VirtualKeyboard
Asked by
Chris
Top achievements
Rank 2
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Chris
Top achievements
Rank 2
Iron
Share this question
or