Windows CE changes (from <Someone>)

The changes did not apply to the main trunk as easily as I wouuld have
hoped, so I attempted a number of manual applications. I hope <Someone>
can tell me if there is a problem.

Changelist:
- bugfix: help text windows close immediately after open (unhandled WM_KEYDOWN in mhtext.c)
- bugfix: action button uses hero coordinates instead of cursor position
- pocketpc: bugfix: menu window closes on up/down keys from first/last position
- smartphone: do not translate input when command helper is hidden (fixes Motorola Q keyboard bug)
- smartphone: new keypad layouts
- smartphone: wizard mode command layout
- smartphone: option to feed arbitrary text as a command to nethack core
- wrap/unwrap text option for text windows
- hardware keyboard detection
- hide keypad when hardware keyboard is present
- backport message window highlighting from winnt port
- new icon with recommended image sizes
This commit is contained in:
nethack.allison
2009-10-10 14:39:53 +00:00
parent 1ad1e07d7a
commit 142f13de3f
18 changed files with 844 additions and 81 deletions
+21 -2
View File
@@ -1891,7 +1891,7 @@ void mswin_set_fullscreen(BOOL is_fullscreen)
}
#if defined(WIN_CE_SMARTPHONE)
void NHSPhoneDialogSetup(HWND hDlg, BOOL is_edit, BOOL is_fullscreen)
void NHSPhoneDialogSetup(HWND hDlg, UINT nToolBarId, BOOL is_edit, BOOL is_fullscreen)
{
SHMENUBARINFO mbi;
HWND hOK, hCancel;
@@ -1901,7 +1901,7 @@ void NHSPhoneDialogSetup(HWND hDlg, BOOL is_edit, BOOL is_fullscreen)
ZeroMemory(&mbi, sizeof(SHMENUBARINFO));
mbi.cbSize = sizeof(mbi);
mbi.hwndParent = hDlg;
mbi.nToolBarId = IDC_SPHONE_DIALOGBAR;
mbi.nToolBarId = nToolBarId;
mbi.hInstRes = GetNHApp()->hApp;
if(!SHCreateMenuBar(&mbi)) {
error("cannot create dialog menu");
@@ -1961,6 +1961,25 @@ void mswin_write_reg(void)
{
}
/* check HKCU\Software\\Microsoft\\Shell\HasKeyboard for keyboard presence,
if the key is not there assume older device and no keyboard */
BOOL mswin_has_keyboard(void)
{
DWORD dwHasKB = 0;
#if defined(WIN_CE_POCKETPC) || defined(WIN_CE_SMARTPHONE)
HKEY hKey;
DWORD dwType;
DWORD dwSize = sizeof(dwHasKB);
if( RegOpenKeyEx(HKEY_CURRENT_USER , _T("Software\\Microsoft\\Shell"), 0, 0, &hKey)==ERROR_SUCCESS) {
if( RegQueryValueEx(hKey, _T("HasKeyboard"), NULL, &dwType, (LPBYTE)&dwHasKB, &dwSize)!=ERROR_SUCCESS) {
dwHasKB = 0;
}
RegCloseKey(hKey);
}
#endif
return (dwHasKB==1);
}
#ifdef _DEBUG
#include <stdarg.h>