diff --git a/src/Carnac/UI/KeyShowView.xaml b/src/Carnac/UI/KeyShowView.xaml index 03e05521..879abcbf 100644 --- a/src/Carnac/UI/KeyShowView.xaml +++ b/src/Carnac/UI/KeyShowView.xaml @@ -16,6 +16,8 @@ + + @@ -59,21 +61,21 @@ - - - @@ -88,21 +90,21 @@ - - - @@ -117,35 +119,35 @@ - - - - - @@ -160,35 +162,35 @@ - - - - - @@ -203,35 +205,35 @@ - - - - - @@ -246,35 +248,35 @@ - - - - - @@ -289,35 +291,35 @@ - - - - - @@ -429,7 +431,7 @@ - + @@ -443,26 +445,7 @@ - - - - - - - - - - - - - - - - - - - - + diff --git a/src/Carnac/UI/ToSpecialKeyConverter.cs b/src/Carnac/UI/ToSpecialKeyConverter.cs new file mode 100644 index 00000000..185b2858 --- /dev/null +++ b/src/Carnac/UI/ToSpecialKeyConverter.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Windows.Data; + +namespace Carnac.UI +{ + public class ToSpecialKeyConverter : IValueConverter + { + + private readonly List specialKeys = new List(){ + "Escape", + "Alt", + "Ctrl", + "Shift", + "Tab", + "Delete", + "Insert", + "Home", + "Next", + "PageUp", + "PageDown", + "End", + "Back", + "NumLock", + "PrintScreen", + "Scroll", + "Capital", + "F1", + "F2", + "F3", + "F4", + "F5", + "F6", + "F7", + "F8", + "F9", + "F10", + "F11", + "F12", + "Apps", + "BrowserHome", + }; + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return specialKeys.Contains(value.ToString()) ? "SPECIAL_KEY" : value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +}