Unplanned
Last Updated: 08 Apr 2020 06:20 by ADMIN
Yannis
Created on: 27 Mar 2020 13:46
Category: VirtualKeyboard
Type: Bug Report
0
RadVirtualKeyboard: when a key is pressed on the touch screen, the key remains highlighted and the repeat button functionality does not work

Hello,

I tried using the VirtualKeyboard on a touch screen and I do not see the expected behavior that I see on a normal pc.

In more details, when a key is pressed on the touch screen, the key remains highlighted. Additionally when a button is pressed for a couple of seconds, then you can not see the repeating press behavior of the button on the screen (like you see on a normal pc) and you only notice a single press behavior.

Is there a possibility to add a button sound each time a key is pressed?

 

Regards,

Yannis 

5 comments
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 08 Apr 2020 06:20

 

Hello, Yannis,  

Indeed, the provided video shows incorrect side effect of the suggested solution when managing the Cursor.Position outside the bounds of the touched key. 

An alternative solution that I can suggest is to set the Cursor.Position to 0,0
        private void T_Tick(object sender, EventArgs e)
        {
            t.Stop();
            Cursor.Position = new Point(0,0); 
        }
As to the Beep sound, it is not expected to be delayed since the System.Media.SystemSounds.Beep.Play method is called in the KeySent event, not the timer's Tick

If you need any further assistance please don't hesitate to contact me.  

 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Yannis
Posted on: 01 Apr 2020 15:02

Hello Dess,

Theoretically your approach with the timer is correct, but the point.X--, point.Y-- behave abnormally and buttons seem to be pressed while they are not. Please see the attached video and you will understand what exactly I mean.

I had to remove the sound 'Beep.Play()' because the delay of the Beep will definitely be unacceptable by our clients.

Regards,

Yannis

Attached Files:
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 01 Apr 2020 11:56
Hello, Yannis,

Note that you can use a timer and simulate the mouse cursor moving outside the pressed key's bounds with a certain delay:
        Timer t = null;
        Point point = Point.Empty;
        private void radVirtualKeyboard1_KeySent(object sender, Telerik.WinControls.VirtualKeyboard.VirtualKeyboardKeySentEventArgs e)
        {
            RadItem item = e.Key as RadItem;
            if (item != null)
            {
                point = this.radVirtualKeyboard1.PointToScreen(item.ControlBoundingRectangle.Location);
                t = new Timer();
                t.Interval = 1000;
                t.Tick += T_Tick; t.Start(); 
                System.Media.SystemSounds.Beep.Play();
            }
        }

        private void T_Tick(object sender, EventArgs e)
        {
            t.Stop();
            point.X--;
            point.Y--;
            Cursor.Position = point; 
        }
As to the beep sound, I confirm that it is a reasonable request. I have logged it in our feedback portal by creating a public thread on your behalf. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.


Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Yannis
Posted on: 01 Apr 2020 08:01

Hello Dess,

The code that you provided about hiding the color of the selected button is working, but now you do not see the color of the pressed button at all. So, the user does not get the feeling that he touched the button. It would be nice if you could see that color for a while before it disappears.

 

As for the link of code about the sound that you provided, it would be nice if the RadVirtualKeyboard control could include that as a feature, instead of doing that programmatically externally. I am sure that it will be faster if you include it in your control.

 

Regards,

Yannis 

ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 30 Mar 2020 07:34

Hello, Yannis,

Every RadControl tracks for the WM_GESTURE message. This message is not received on touch devices but is translated to mouse events and we cannot determine whether the click comes from Mouse or Touch gesture. Why does the button state is MouseOver after a tap on a touch device? Because when tapping, the control receives click/mouse up/down event/s and mouse position is changed over the button. The highlight comes from the hover state for the key.

I confirm that it is an issue with RadVirtualKeyboard and I have logged it in our feedback portal by making this thread public. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to simulate moving the mouse outside the tapped key: 

        private void radVirtualKeyboard1_KeySent(object sender, Telerik.WinControls.VirtualKeyboard.VirtualKeyboardKeySentEventArgs e)
        {
            RadItem item = e.Key as RadItem;
            if (item != null)
            {
                Point point = this.radVirtualKeyboard1.PointToScreen(item.ControlBoundingRectangle.Location);
                point.X--;
                point.Y--;
                Cursor.Position = point;
            }
        }

As to the repeat button's functionality, due to the specificity of the mouse/touch messages that are received on a touch device, I am unable to provide a suitable solution. We will do our best to introduce a fix accordingly. Please excuse us for the inconvenience caused.

Playing a sound when you click a button is more like a general programming question. After some research, I have found the following useful StackOverflow thread which demonstrates a simple solution which I believe you would fit your case: https://stackoverflow.com/questions/23643468/how-do-i-code-my-winforms-application-play-a-system-sound 

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

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.