支持 WASD 键位控制方块

This commit is contained in:
2026-04-24 10:47:01 +08:00
parent 141405c5f5
commit c8f90621b6
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -230,18 +230,21 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
switch (wParam)
{
case VK_LEFT:
case 'A':
if (CanMoveLeft())
{
MoveLeft();
}
break;
case VK_RIGHT:
case 'D':
if (CanMoveRight())
{
MoveRight();
}
break;
case VK_DOWN:
case 'S':
if (CanMoveDown())
{
MoveDown();
@@ -254,6 +257,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
break;
case VK_UP:
case 'W':
Rotate();
break;
case VK_SPACE: