aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch/Keyboard
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-05-31 17:23:18 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-05-31 17:23:18 +0300
commitf5a3a56e6737a3acaa759a5ff04347cc6a252f24 (patch)
treef958956cf91803bdefc9e64bc6f5e200033af37d /Software/Visual_Studio/Tango.Touch/Keyboard
parent6f27e675c8349d873f683255ae842a4de59ebde7 (diff)
downloadTango-f5a3a56e6737a3acaa759a5ff04347cc6a252f24.tar.gz
Tango-f5a3a56e6737a3acaa759a5ff04347cc6a252f24.zip
Working on PPC.
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Keyboard')
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
index d92fe4bb8..efb75d5f7 100644
--- a/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
@@ -50,6 +50,13 @@ namespace Tango.Touch.Keyboard
/// </summary>
public class TouchKeyboard : Control
{
+ //The system keyboard event.
+ [System.Runtime.InteropServices.DllImport("user32.dll", SetLastError = true)]
+ static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);
+ public const int KEYEVENTF_EXTENDEDKEY = 0x0001; //Key down flag
+ public const int KEYEVENTF_KEYUP = 0x0002; //Key up flag
+ public const int VK_CONTROL = 0xA3; //Control key code
+
static TouchKeyboard()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchKeyboard), new FrameworkPropertyMetadata(typeof(TouchKeyboard)));
@@ -392,6 +399,16 @@ namespace Tango.Touch.Keyboard
});
}
+ public static void PressCtrl()
+ {
+ keybd_event(VK_CONTROL, 0, KEYEVENTF_EXTENDEDKEY, 0);
+ }
+
+ public static void ReleaseCtrl()
+ {
+ keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);
+ }
+
private void OnSpecialCharactersOnChanged()
{
if (!IsSpecialCharactersOn)