Movement controls: A critical look

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Irashtar
    Scout
    • Oct 2007
    • 37

    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.
  • Bandobras
    Knight
    • Apr 2007
    • 726

    #2
    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...

    Comment

    • zaimoni
      Knight
      • Apr 2007
      • 590

      #3
      Originally posted by Irashtar
      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.
      Originally posted by Irashtar
      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.
      Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg.
      Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.)
      Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011

      Comment

      • Irashtar
        Scout
        • Oct 2007
        • 37

        #4
        Sigh. I'm using vista, do you know of any key remapping program that would let me work around this?

        Comment

        • roustk
          Adept
          • Dec 2007
          • 167

          #5
          Originally posted by Irashtar
          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:
          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).

          Comment

          • Irashtar
            Scout
            • Oct 2007
            • 37

            #6
            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?

            Comment

            • zaimoni
              Knight
              • Apr 2007
              • 590

              #7
              Originally posted by Irashtar
              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.)
              Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg.
              Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.)
              Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011

              Comment

              Working...
              😀
              😂
              🥰
              😘
              🤢
              😎
              😞
              😡
              👍
              👎