aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch/Keyboard
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-06-06 18:39:17 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-06-06 18:39:17 +0300
commitcff4a8079c4d352cfd47793c701650e62337ed6e (patch)
treeaf145431e541f08ed99b1d3ae377d8a59faedc4f /Software/Visual_Studio/Tango.Touch/Keyboard
parent776d934a1adc8c58301e56f6639afdeeccb0dda6 (diff)
downloadTango-cff4a8079c4d352cfd47793c701650e62337ed6e.tar.gz
Tango-cff4a8079c4d352cfd47793c701650e62337ed6e.zip
Working on PPC..
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Keyboard')
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs37
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/keyboard-iphone.wavbin0 -> 50036 bytes
2 files changed, 8 insertions, 29 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
index 764299ef4..b0728e087 100644
--- a/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
@@ -16,40 +16,15 @@ using System.Windows.Shapes;
using Tango.Core.Commands;
using System.Threading;
using System.Collections.ObjectModel;
+using System.Media;
+using Tango.Core.Helpers;
namespace Tango.Touch.Keyboard
{
- /// <summary>
- /// Follow steps 1a or 1b and then 2 to use this custom control in a XAML file.
- ///
- /// Step 1a) Using this custom control in a XAML file that exists in the current project.
- /// Add this XmlNamespace attribute to the root element of the markup file where it is
- /// to be used:
- ///
- /// xmlns:MyNamespace="clr-namespace:Tango.Touch.Keyboard"
- ///
- ///
- /// Step 1b) Using this custom control in a XAML file that exists in a different project.
- /// Add this XmlNamespace attribute to the root element of the markup file where it is
- /// to be used:
- ///
- /// xmlns:MyNamespace="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch.Keyboard"
- ///
- /// You will also need to add a project reference from the project where the XAML file lives
- /// to this project and Rebuild to avoid compilation errors:
- ///
- /// Right click on the target project in the Solution Explorer and
- /// "Add Reference"->"Projects"->[Browse to and select this project]
- ///
- ///
- /// Step 2)
- /// Go ahead and use your control in the XAML file.
- ///
- /// <MyNamespace:TouchKeyboard/>
- ///
- /// </summary>
public class TouchKeyboard : Control
{
+ private SoundPlayer _soundPlayer;
+
//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);
@@ -288,6 +263,8 @@ namespace Tango.Touch.Keyboard
NextLanguageCommand = new RelayCommand(NextLanguage);
ActionKeyCommand = new RelayCommand(InvokeActionKey);
NumericKeyCommand = new RelayCommand<object>((x) => SendKeys(x.ToString().Replace("'", "")));
+
+ _soundPlayer = new SoundPlayer(EmbeddedResourceHelper.GetEmbeddedResourceStream("Tango.Touch.Keyboard.keyboard-iphone.wav"));
}
private void Initialize()
@@ -389,6 +366,8 @@ namespace Tango.Touch.Keyboard
return Task.Factory.StartNew(() =>
{
+ _soundPlayer.Play();
+
if (isSpecialChar && definition.KeysLinesDefinitions.SelectMany(x => x.KeyDefinitions).Select(x => x.StandardText).Contains(key))
{
Forms.SendKeys.SendWait("{" + key + "}");
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/keyboard-iphone.wav b/Software/Visual_Studio/Tango.Touch/Keyboard/keyboard-iphone.wav
new file mode 100644
index 000000000..760322f91
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/keyboard-iphone.wav
Binary files differ