Display Unicode character for keys in HotkeySettingsControl (#2249)

* Fix HotkeyControl virtual key display

* A new interop project was setup to provide wrappers for C# projects
  that want to access functionality in the common project.

* Add assembly info

* Remove WIN32 configurations
This commit is contained in:
Tomas Agustin Raies
2020-04-20 21:01:21 -07:00
committed by GitHub
parent d45c4740ad
commit 93752fb6cb
31 changed files with 868 additions and 350 deletions

View File

@@ -2,6 +2,8 @@
#include "Helpers.h"
#include <sstream>
using namespace winrt::Windows::Foundation;
namespace KeyboardManagerHelper
{
// Function to split a wstring based on a delimiter and return a vector of split strings
@@ -14,12 +16,12 @@ namespace KeyboardManagerHelper
{
splittedStrings.push_back(item);
}
return splittedStrings;
}
// Function to return the next sibling element for an element under a stack panel
winrt::Windows::Foundation::IInspectable getSiblingElement(winrt::Windows::Foundation::IInspectable const& element)
IInspectable getSiblingElement(IInspectable const& element)
{
FrameworkElement frameworkElement = element.as<FrameworkElement>();
StackPanel parentElement = frameworkElement.Parent().as<StackPanel>();
@@ -28,7 +30,7 @@ namespace KeyboardManagerHelper
parentElement.Children().IndexOf(frameworkElement, index);
return parentElement.Children().GetAt(index + 1);
}
// Function to check if the key is a modifier key
bool IsModifierKey(DWORD key)
{
@@ -75,4 +77,14 @@ namespace KeyboardManagerHelper
return false;
}
}
Collections::IVector<IInspectable> ToBoxValue(const std::vector<std::wstring>& list)
{
Collections::IVector<IInspectable> boxList = single_threaded_vector<IInspectable>();
for (auto& val : list)
{
boxList.Append(winrt::box_value(val));
}
return boxList;
}
}