MCPcopy Create free account
hub / github.com/NetHack/NetHack / mswin_has_keyboard

Function mswin_has_keyboard

outdated/sys/wince/mswproc.c:1934–1952  ·  view source on GitHub ↗

check HKCU\Software\\Microsoft\\Shell\HasKeyboard for keyboard presence, if the key is not there assume older device and no keyboard */

Source from the content-addressed store, hash-verified

1932/* check HKCU\Software\\Microsoft\\Shell\HasKeyboard for keyboard presence,
1933 if the key is not there assume older device and no keyboard */
1934BOOL
1935mswin_has_keyboard(void)
1936{
1937 DWORD dwHasKB = 0;
1938#if defined(WIN_CE_POCKETPC) || defined(WIN_CE_SMARTPHONE)
1939 HKEY hKey;
1940 DWORD dwType;
1941 DWORD dwSize = sizeof(dwHasKB);
1942 if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Shell"), 0,
1943 0, &hKey) == ERROR_SUCCESS) {
1944 if (RegQueryValueEx(hKey, _T("HasKeyboard"), NULL, &dwType,
1945 (LPBYTE) &dwHasKB, &dwSize) != ERROR_SUCCESS) {
1946 dwHasKB = 0;
1947 }
1948 RegCloseKey(hKey);
1949 }
1950#endif
1951 return (dwHasKB == 1);
1952}
1953
1954#ifdef _DEBUG
1955#include <stdarg.h>

Callers 1

WinMainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected