Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old July 2, 2008, 16:50   #1
Irashtar
Scout
 
Join Date: Oct 2007
Location: Estonia
Posts: 37
Irashtar is on a distinguished road
Movement controls: A critical look

So, After dropping FAangband until the next version (Waiting for F1-F12 to work in macros) I return to vanilla for the classic taste of angband. After living in the overworld of FAang and getting hooked to using shift and ctrl + numpad, I try to figure out how to duplicate the feature in V.
AFAIK, there's three main ways you can control your character's movement in angband by default, each with pros and cons.
roguelike (vi keys) is good if you're used to them I guess, but a bit unintuitive, and in the rare cases you have a split ergonomic keyboard, SW is broken away from all the other direction keys.
The numpad option is actually two options, very similar, but affect the rest of the control scheme in very different ways.
If numlock is off, the advantage is that you can use shift and ctrl to run and alter quicker and easier than having to tap . and +. the disadvantage is the right next to the numpad is a perfect bank of 10 keys just begging to become macros for your favorite mage or priest. However, angband sees those keys as exactly the same as the unnumlocked numpad, so no dice.
If numlock is on, you can use those keys as macros, but at the cost of losing the shift and ctrl advantage. shift disables the numlock for some reason, causing shift 3 to become Pgdn, and ctrl 3 isn't even SEEN!
I'm sure this is fixable, in one of three ways, most preferable first.
1) Fix the numpad with numlock so it isn't seen as the same as the arrows/pageup/down/home/end keys when shift is pressed, have it return shift-numpad0-9.
2) Seperate the keymaps so with numpad off, Angband can tell the difference between the two sets of keys.
3) third party program that'll remap one set to F13+ or some other spot not usually found on the keyboard.
Irashtar is offline   Reply With Quote
Old July 2, 2008, 19:00   #2
Bandobras
Knight
 
Join Date: Apr 2007
Posts: 725
Bandobras is on a distinguished road
I have no such problem under Linux, neither in X11 nor in SDL port. Perhaps make live-CD with Linux and Angband and play that? I wonder if any of the standard Linux live-CDs have Angband on them. A few years ago I spent productively 2 weeks without a HD thanks to a live floppy with Angband, that even saved games! Those were the times...
Bandobras is offline   Reply With Quote
Old July 2, 2008, 20:06   #3
zaimoni
Knight
 
zaimoni's Avatar
 
Join Date: Apr 2007
Posts: 590
zaimoni is on a distinguished road
Quote:
Originally Posted by Irashtar View Post
The numpad option is actually two options, very similar, but affect the rest of the control scheme in very different ways.
If numlock is off, the advantage is that you can use shift and ctrl to run and alter quicker and easier than having to tap . and +. the disadvantage is the right next to the numpad is a perfect bank of 10 keys just begging to become macros for your favorite mage or priest. However, angband sees those keys as exactly the same as the unnumlocked numpad, so no dice.
If numlock is on, you can use those keys as macros, but at the cost of losing the shift and ctrl advantage. shift disables the numlock for some reason, causing shift 3 to become Pgdn, and ctrl 3 isn't even SEEN!
This has been true for Microsoft systems in general since at least DOS 2.0, at least when keypresses rather than keycodes are being processed. I'd guess you're on Windows.
Quote:
Originally Posted by Irashtar View Post
I'm sure this is fixable, in one of three ways, most preferable first.
1) Fix the numpad with numlock so it isn't seen as the same as the arrows/pageup/down/home/end keys when shift is pressed, have it return shift-numpad0-9.
2) Seperate the keymaps so with numpad off, Angband can tell the difference between the two sets of keys.
3) third party program that'll remap one set to F13+ or some other spot not usually found on the keyboard.
If you're on Windows, #1 and #2 are impossible without a radical rewrite of the backend to avoid keypress event processing.
zaimoni is offline   Reply With Quote
Old July 2, 2008, 21:46   #4
Irashtar
Scout
 
Join Date: Oct 2007
Location: Estonia
Posts: 37
Irashtar is on a distinguished road
Sigh. I'm using vista, do you know of any key remapping program that would let me work around this?
Irashtar is offline   Reply With Quote
Old July 2, 2008, 22:09   #5
roustk
Adept
 
Join Date: Dec 2007
Posts: 167
roustk is on a distinguished road
Quote:
Originally Posted by Irashtar View Post
Sigh. I'm using vista, do you know of any key remapping program that would let me work around this?
This behavior is fixed by standards, mainly the Keyboard Scan Code Specification from Microsoft.

You are essentially going to need to find a program that works on the raw output of the keyboard (or the i8042 chip). The only difference between, say, PgUp and numpad-9 is that PgUp sends 0xE0 before numpad-9 scan code. This applies to all rendundant keys -- right ALT is E0 39 while left ALT is 39.

Angband uses only the main part of the scan code for keymaps and macros (and I don't think that it even receives the E0 prefix). At least, I can't find any code that throws it away.

The interaction of shift and numlock is also fixed by the standard. For most keys, things act as normal -- every keypress and release is noted. The 10 special keys (arrows, insert, delete, pgup, pgdn, home, end) are treated specially, however:
Quote:
If numlock is on and either (or both) shift are down, proceed normally.
If numlock is on and neither shift is down, precede these keypresses by left-shift press and follow these keyreleases by left-shift release.

If numlock is off and neither shift is down, proceed normally.
If numlock is off and either (or both) shift are down, precede these keypresses with the appropriate shift release (and keyreleases with appropriate shift press).
roustk is offline   Reply With Quote
Old July 3, 2008, 10:44   #6
Irashtar
Scout
 
Join Date: Oct 2007
Location: Estonia
Posts: 37
Irashtar is on a distinguished road
So, are you saying it would be impossible to recode angband for this, or just very difficult? If it's the latter, I think it would be worth putting a low priority Bug ticket up.
Also, I'm a complete dunce beyond "each key has it's own hex code", is there a program I can use to quickly obtain a pressed key's code?
Irashtar is offline   Reply With Quote
Old July 3, 2008, 18:00   #7
zaimoni
Knight
 
zaimoni's Avatar
 
Join Date: Apr 2007
Posts: 590
zaimoni is on a distinguished road
Quote:
Originally Posted by Irashtar View Post
So, are you saying it would be impossible to recode angband for this, or just very difficult? If it's the latter, I think it would be worth putting a low priority Bug ticket up.
Also, I'm a complete dunce beyond "each key has it's own hex code", is there a program I can use to quickly obtain a pressed key's code?
I haven't looked carefully to see if there is a suitable WinAPI for GUI mode that does this. There should to be one around somewhere, as DOS emulation can get at the scan codes fine.

(Terminology changed because I actually looked at a PDF I made of this. The original site I made the PDF from is down, but Googling "keyboard scan codes" turns up more than a few references.)
zaimoni is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Smarter Movement ... please have a look TJA Vanilla 0 August 21, 2007 17:14


All times are GMT +1. The time now is 11:02.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.