MCPcopy Create free account
hub / github.com/cmauri/eviacam / FromScanCode

Method FromScanCode

src/keyboardcode.cpp:138–149  ·  view source on GitHub ↗

Given an scan code returns the corresponding CKeyboardCode object

Source from the content-addressed store, hash-verified

136
137// Given an scan code returns the corresponding CKeyboardCode object
138KeyboardCode KeyboardCode::FromScanCode (int scanCode) {
139 #if defined(__WXGTK__)
140 KeySym ks= XkbKeycodeToKeysym(
141 static_cast<Display *>(wxGetDisplay()),
142 static_cast<KeyCode>(scanCode), 0, 0);
143 return KeyboardCode(static_cast<int>(ks));
144 #else
145 UINT vKCode= ::MapVirtualKey(scanCode, MAPVK_VSC_TO_VK_EX);
146 assert (vKCode< 0xFFFF);
147 return KeyboardCode(vKCode);
148 #endif
149}
150
151// Given an wxKeyCode code returns the corresponding CKeyboardCode object
152KeyboardCode KeyboardCode::FromWXK (wxKeyCode kc) {

Callers

nothing calls this directly

Calls 1

KeyboardCodeClass · 0.85

Tested by

no test coverage detected