Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using subkeyvalues to rotate numpad for Samsung Pocket PC

6 views
Skip to first unread message

disperse....@gmail.com

unread,
May 27, 2008, 12:27:28 PM5/27/08
to
Hi all,

I recently acquired a Samsung i760 phone that seems promising for
mobile Nethacking.

It slides open with access to a QWERTY keyboard and has a numeric
keypad in addition.

When held like a phone, the keypad is set up for dialing as so:

1 2 3
4 5 6
7 8 9

When turned to the side for access to the keyboard the numbers look
like:

3 6 9
2 5 8
1 4 7

If I want to translate the keypresses so 2 is left, 6 is up, etc. I
need to rebind the keypad keys as follows:
3 -> 7, 6 -> 8, 2 -> 4, 8 -> 6, 4 -> 2, 7 -> 3

Reading through the documentation on subkeyvalues it seems to want to
take ASCII pairs as follows:

OPTIONS=subkeyvalue:51/55, subkeyvalue:54/56, subkeyvalue:50/52,
subkeyvalue:56/54, subkeyvalue:52/50, subkeyvalue:55/51

I add this line to my defaults.nh file but the keybinding doesn't
take. (8 is still up, 2 is still down, etc.)

I'm using the Windows CE version of Nethack 3.43 for Pocket PC:
http://www.nethack.org/v343/ports/download-wince.html#ppc

Anyone have any ideas?

Thanks,

Mark.

ran...@pactechdata.com

unread,
May 28, 2008, 12:25:07 AM5/28/08
to
On May 27, 9:27 am, disperse.record...@gmail.com wrote:
[...]

> Reading through the documentation on subkeyvalues it seems to want to
> take ASCII pairs as follows:
>
> OPTIONS=subkeyvalue:51/55, subkeyvalue:54/56, subkeyvalue:50/52,
> subkeyvalue:56/54, subkeyvalue:52/50, subkeyvalue:55/51

Remapping actual digits would lead to madness. Think about
how you'd enter a count when one is needed.

> I add this line to my defaults.nh file but the keybinding doesn't
> take. (8 is still up, 2 is still down, etc.)
>
> I'm using the Windows CE version of Nethack 3.43 for Pocket
> PC:http://www.nethack.org/v343/ports/download-wince.html#ppc

The subkey stuff is only supported by the WinNT port. That's
the one for normal Windows. The WinCE port doesn't know anything
about the subkeyvalue option, other than to silently ignore it in
case it's present in a shared config file.

I think you're going to have to break down and learn to use
the hjkl movement keys. The post-3.4.3 development code has
extended the number_pad option to support the upside down keypad
variant used by phones, but even that wouldn't be any help with a
sideways orientation. (Unlike subkeyvalue, number_pad is handled
by the core of nethack so applies to all of its ports.)

disperse....@gmail.com

unread,
May 28, 2008, 10:03:32 AM5/28/08
to
On May 28, 12:25 am, ran...@pactechdata.com wrote:
>      Remapping actual digits would lead to madness.  Think about
> how you'd enter a count when one is needed.

I'd be OK with the numbers being switched around. I only really use
the count when I'm sitting on an altar. Also the 9 key doesn't move
(so n-99-s or n-999-s would stay the same).

>      The subkey stuff is only supported by the WinNT port.  That's
> the one for normal Windows.  The WinCE port doesn't know anything
> about the subkeyvalue option, other than to silently ignore it in
> case it's present in a shared config file.
>
>      I think you're going to have to break down and learn to use
> the hjkl movement keys.  The post-3.4.3 development code has
> extended the number_pad option to support the upside down keypad
> variant used by phones, but even that wouldn't be any help with a
> sideways orientation.  (Unlike subkeyvalue, number_pad is handled
> by the core of nethack so applies to all of its ports.)

I normally use the hjkl movement keys. The trouble with using those
keys on my phone's qwerty keyboard is there is no CTRL or ALT key. To
do common things like loot or kick I need to hit Num-H (#) to bring up
an extended menu, press l/k, and then press 'OK' with my finger or the
stylus. That's four steps instead of two and includes moving my
fingers off the keyboard. It's too bad there isn't any easy way to
rebind keys...

a@b.c

unread,
May 28, 2008, 12:37:31 PM5/28/08
to
On Tue, 27 May 2008 09:27:28 -0700 (PDT)
disperse....@gmail.com wrote:

>
> Anyone have any ideas?
>
> Thanks,
>
> Mark.
>

Hi Mark,

Looking through the wince code I found this in mhcmd.h:

#if defined(WIN_CE_SMARTPHONE)
/* special keypad input handling for SmartPhone */
BOOL NHSPhoneTranslateKbdMessage(WPARAM wParam, LPARAM lParam, BOOL keyDown);
void NHSPhoneSetKeypadFromString(const char* str);
void NHSPhoneSetKeypadDirection();
void NHSPhoneSetKeypadDefault();
#endif

and then looked at the webpage where you got your current version.
I noticed they have a special version for Smartphones. I am guessing
that version won't work with your phone since its compiled for the
arm processor? If you are able to compile your own version you might
be able to leverage that code to your build, but it may or may not
be plausible. Just throwin' out an idea, sorry if it doesn't apply
or doesn't turn out to be helpful. Good luck!

disperse....@gmail.com

unread,
May 29, 2008, 9:26:49 AM5/29/08
to
On May 28, 12:37 pm, a...@b.c wrote:
> On Tue, 27 May 2008 09:27:28 -0700 (PDT)
>

Thanks for the information. I've never done any C development (only C+
+ and C#) but this may be a good project when I have some free time.
I'll consider it...

Mark.

0 new messages