Unplanned
Last Updated: 29 Apr 2024 13:00 by Martin Ivanov

The CapsLock key should toggle only the letters. Currently, it behaves as Shift because it shows the secondary text of other keys as well (for example the number keys and their special characters). To reproduce this the ShowSecondaryText attribute of the corresponding key should be set to False.

To work this around, you can create a custom view model for the numeric keys that updates the DisplayText manually.

 

public class CustomKeyFactory : DefaultKeyFactory
{
    public override BaseKeyViewModel CreateKey(int virtualKey, KeyType keyType = KeyType.Normal, string displayText = null, double width = 1, double height = 1, int alternateVirtualKey = -1, string alternateText = null, bool showSecondaryText = false)
    {
        if (keyType == KeyType.Normal)
        {
            return new CustomRegularKeyViewModel(virtualKey, width, height, showSecondaryText, displayText);
        }
        return base.CreateKey(virtualKey, keyType, displayText, width, height, alternateVirtualKey, alternateText, showSecondaryText);
    }
}

public class CustomRegularKeyViewModel : RegularKeyViewModel
{
    public CustomRegularKeyViewModel(int virtualKey, double keyWidth, double keyHeight, bool showSecondaryText, string displayText = null) : base(virtualKey, keyWidth, keyHeight, showSecondaryText, displayText)
    {
    }

    public override void Update(IKeyUpdateContext context)
    {            
        base.Update(context);
        if (this.VirtualKey >= 48 && this.VirtualKey <= 57) // you may need to extend the if-statement to check for other keys as well
        {
            this.DisplayText = context.IsShiftActive ? this.ShiftText : this.LowerText;
        }
    }
}

 

Unplanned
Last Updated: 17 Apr 2024 07:23 by Martin Ivanov
Created by: Martin Ivanov
Comments: 0
Category: VirtualKeyboard
Type: Feature Request
0
Add an event on the RadVirtualKeyboard class that is raised when a key button is pressed. For example, KeyPressed or something like this. 
Unplanned
Last Updated: 22 May 2023 12:19 by Patrick
Hook to external keyboard special keys degrades performance the control so it might be useful to provide an API to disable this functionality.
Unplanned
Last Updated: 05 Apr 2023 09:13 by Martin Ivanov
On English keyboard the AltGr key is treated as Right Alt key which behaves the same as the standard (Left) Alt key. However, on some cultures (like French) the AltGr key is used as a modifier that toggles few special keys. This behavior is similar to holding the Shift key, but the set of special keys that are activated is different.

Currently, RadVirtualKeyboard doesn't support the special behavior of the AltGr key.