Dependency on keyboard layout?

I am making a small change to Tigris and Euphrates. The main motivation was making battles clearer (and including a pdf of the rules). However obviously I found a small rabbit-hole and fell down it.

First of all I found I should probably stop the role from accessing certain commands, because some of them depend on the user name. (I can’t deny it ownership because that breaks as much as it fixes.) So at that point I should deny it access to all of them.

So tiles have commands “CTRL CLOSE_BRACKET” and “CTRL OPEN_BRACKET”. So when I try to restrict those I can’t. All I can restrict are “CTRL SHIFT 0” and “CTRL SHIFT 9”. Then I wonder do those key commands even work? Answer: No.

Note those key commands were not entered by me. They were there in pre-me versions of the module.

So if I change “CTRL CLOSE_BRACKET” to “CTRL SHIFT 0” I will fix it for me. But will I be breaking it for someone else? Does the current key binding work for anybody? How broken is it? Is it broken until we get to VASSAL 4?

Looking at this link: https://en.wikipedia.org/wiki/British_and_American_keyboards, it seems I am pretty safe at switch to what works for me. However the questions remain:

  1. How did the previous maintainer even do that?
  2. Is there an issue here that VASSAL needs to address?
  3. How urgently?

FYI, for me, on a standard US keyboard layout, CTRL OPEN_BRACKET worked just fine when I temporarily added it to a command on the module I’m working on (I didn’t test the close bracket).

Edit: It occurs to me that in the UK “bracket” typically refers to what in the US are always called parentheses. Just to make sure, you were using the two keys to the right of “P” to test, right? Those are the actual “brackets” in the US…

Ah thanks. You are right. The symbols above the 0 and 9 we call “brackets” or if we are feeling pompously pedantic “parentheses”. The symbols to the right of the “9” we call “square brackets”. The shifted versions we call them “braces” or “curly brackets”. I realised I might have been foiled by a US keyboard but it did not occur to me I had been foiled by US spoken language.

Thus spake slimy:

Are thanks. You are right. The symbols above the 0 and 9 we call
“brackets” or if we are feeling pompously pedantic “parentheses”. The
symbols to the right of the “9” we call “square brackets”. Above them we
call them “braces” or “curly brackets”. I realised I might have been
foiled by a US keyboard but it did not occur to me I had been foiled by
US spoken language.

This issue turns out to be horrendously confusing when you’re a non-Brit
teaching mathematics, logic, or computer science in the UK and you have
notation where there are parentheses, braces, square brackets, and angle
brackets and they all mean different things…


J.

We lived in Richmond, North Yorkshire for a year, and my wife was teaching “Year 1’s”. For gym at that age, the kids would just do it in their underwear. So one day when it was time for gym she logically announced “Okay, everybody, it’s time for gym, TAKE OFF YOUR PANTS!” The kids reaction was one for the ages…

So it would be an idea if in the menu we showed “CTRL ]” rather than “CTRL CLOSE_BRACKET”. I think this could be done with a bit of parsing and a lookup table.

I think the “official” names come from some horrible place deep in Java. But if you want to do it in your own modules, it’s pretty easy custom code, I just override MenuDisplayer and have a routine like…

 //BR// Clean up the ugly default hotkey names
 public static String fixMenuString(String target) {
	  String fixed = target;
	  fixed = fixed.replace("NUMPAD_+", "Numpad+PLUS");
	  fixed = fixed.replace("NUMPAD_-", "Numpad-MINUS");
	  fixed = fixed.replace("PAGE_UP", "PGUP");
	  fixed = fixed.replace("PAGE_DOWN", "PGDN");	  
	  return fixed;
  }

And then in the “createPopup” method I just filter all the parameters to the new JMenu and JMenuItem’s through that.

I do agree it would be nice if we had slightly cleaned up “key names” for Vassal in general though.

On a slightly related topic, does anyone know if other apps are known to interfere with the Vassal key commands? For instance, I noticed while designing a module in the editor, some key commands invoked hotkeys in the Radeon software running in the background for my video card. I had to add those key commands via text editor. I haven’t observed any issues with the Radeon software, but that got me wondering if that is a potential problem and thus maybe hotkeys in popular background apps should be avoided altogether…

PS Not talking about the user actually invoking those keys (that obviously would activate a hotkey), I’m wondering if Vassal on its own actually ever activates those keystrokes at the operating system level…

That’s completely dependent on the other apps in question and how well/poorly they behave themselves. For example I find that FRAPS will steal hotkeys from anything, even if it’s “dormant”. But there’s nothing Vassal can do about it, it’s an OS level thing.