mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
* Added EditShortcuts Window and added Detecting shortcuts functionality * Fixed build error * Changed detection to take place only when window is in focus * Added solution folder * Added a common project and refactored shared variables to an object with wrapper functions * Added dynamic addition of shortcuts * Moved all shared variables in detection to state variable with wrapper functions * Added code to re-load saved shortcuts in the UI * Added comments * Fixed argument modifiers in Helpers * Updated arg modifiers in all functions * Removed unused headers and added precompiled headers
29 lines
923 B
C++
29 lines
923 B
C++
#include "pch.h"
|
|
#include "Helpers.h"
|
|
#include <sstream>
|
|
|
|
// Function to split a wstring based on a delimiter and return a vector of split strings
|
|
std::vector<std::wstring> splitwstring(const std::wstring& input, wchar_t delimiter)
|
|
{
|
|
std::wstringstream ss(input);
|
|
std::wstring item;
|
|
std::vector<std::wstring> splittedStrings;
|
|
while (std::getline(ss, item, L' '))
|
|
{
|
|
splittedStrings.push_back(item);
|
|
}
|
|
|
|
return splittedStrings;
|
|
}
|
|
|
|
// Function to return the next sibling element for an element under a stack panel
|
|
IInspectable getSiblingElement(IInspectable const& element)
|
|
{
|
|
FrameworkElement frameworkElement = element.as<FrameworkElement>();
|
|
StackPanel parentElement = frameworkElement.Parent().as<StackPanel>();
|
|
uint32_t index;
|
|
|
|
parentElement.Children().IndexOf(frameworkElement, index);
|
|
return parentElement.Children().GetAt(index + 1);
|
|
}
|