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
Hello, Yannis,
private void T_Tick(object sender, EventArgs e)
{
t.Stop();
Cursor.Position = new Point(0,0);
}
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
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
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;
}
I have also updated your Telerik points.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
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
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