MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / ConvertMouseButton

Method ConvertMouseButton

source/script.h:1263–1281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1261 }
1262
1263 static int ConvertMouseButton(LPTSTR aBuf, bool aAllowWheel = true)
1264 // Returns the matching VK, or zero if none.
1265 {
1266 if (!*aBuf || !_tcsicmp(aBuf, _T("LEFT")) || !_tcsicmp(aBuf, _T("L")))
1267 return VK_LBUTTON; // Some callers rely on this default when !*aBuf.
1268 if (!_tcsicmp(aBuf, _T("RIGHT")) || !_tcsicmp(aBuf, _T("R"))) return VK_RBUTTON;
1269 if (!_tcsicmp(aBuf, _T("MIDDLE")) || !_tcsicmp(aBuf, _T("M"))) return VK_MBUTTON;
1270 if (!_tcsicmp(aBuf, _T("X1"))) return VK_XBUTTON1;
1271 if (!_tcsicmp(aBuf, _T("X2"))) return VK_XBUTTON2;
1272 if (aAllowWheel)
1273 {
1274 if (!_tcsicmp(aBuf, _T("WheelUp")) || !_tcsicmp(aBuf, _T("WU"))) return VK_WHEEL_UP;
1275 if (!_tcsicmp(aBuf, _T("WheelDown")) || !_tcsicmp(aBuf, _T("WD"))) return VK_WHEEL_DOWN;
1276 // Lexikos: Support horizontal scrolling in Windows Vista and later.
1277 if (!_tcsicmp(aBuf, _T("WheelLeft")) || !_tcsicmp(aBuf, _T("WL"))) return VK_WHEEL_LEFT;
1278 if (!_tcsicmp(aBuf, _T("WheelRight")) || !_tcsicmp(aBuf, _T("WR"))) return VK_WHEEL_RIGHT;
1279 }
1280 return 0;
1281 }
1282
1283 static CoordModeType ConvertCoordMode(LPTSTR aBuf)
1284 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected