integrate quick brushes, simulate pressed keys on windows active

This commit is contained in:
2019-03-05 23:41:43 +01:00
parent 1cbe9a4a76
commit b0933c29fb
8 changed files with 79 additions and 44 deletions

View File

@@ -877,6 +877,18 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
}
}
}
else
{
for (int i = 0; i < 256; i++)
{
if ((int)convert_key(i) == k)
{
bool down = GetKeyState(i) & 0x8000;
if (down)
App::I.key_down((kKey)k);
}
}
}
}
});
break;
@@ -901,7 +913,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
}
case WM_SYSKEYDOWN:
case WM_KEYDOWN:
if ((lp >> 30 & 1) == 0) // ignore repeated
{
std::lock_guard<std::mutex> lock(task_mutex);
tasklist.emplace_back([wp] {
App::I.key_down(convert_key((int)wp));