Inform 7: Disable Shortcut O Key?

I’ve added a hangman mini game to my game and the O Key returns a message that says “Sorry, that can’t be corrected.” Is there a way to make this not happen?

Side note is that Z works but also produces the “Time passes.” message. Is there a way to disable that as well?

Blockquote
Understand “a” as ABCing. Understand “b” as ABCing. Understand “c” as ABCing. Understand “d” as ABCing. Understand “e” as ABCing. Understand “f” as ABCing. Understand “g” as ABCing. Understand “h” as ABCing. Understand “i” as ABCing. Understand “j” as ABCing. Understand “k” as ABCing. Understand “l” as ABCing. Understand “m” as ABCing. Understand “n” as ABCing. Understand “o” as ABCing. Understand “p” as ABCing. Understand “q” as ABCing. Understand “r” as ABCing. Understand “s” as ABCing. Understand “t” as ABCing. Understand “u” as ABCing. Understand “v” as ABCing. Understand “w” as ABCing. Understand “x” as ABCing. Understand “y” as ABCing. Understand “z” as ABCing. ABCing is an action applying to nothing.

Blockquote

1 Like

It’s possible, but a bit awkward. Which version of Inform are you on?

1 Like

1.82

That’s the version of the IDE. The version of Inform you are compiling with can be found either in the banner text that prints when you hit the “Go” button or by typing “version” at the command prompt of a running game.

1 Like

Inform 7 v10.1.2?

1 Like
Lab is a room.

Include (-
Constant InvalidToken = 'x,y';
-)

Understand "o" as jumping.

Include (-
Global OOPS2__WD = InvalidToken;
-) replacing "OOPS2__WD".

[
Include (-
Global OOPS1__WD = InvalidToken;
-) replacing "OOPS__WD1".

Include (-
Global OOPS3__WD = InvalidToken;
-) replacing "OOPS__WD3".
]

One could uncomment the commented out bits to eliminate oops as well. I have an I7 v11 extension selectively allowing deactivating any or all of o, oops, g, again, undo ready to go for when I7 v11 gets here (no schedule yet). :grinning:

z is easier:

Understand the command "z" as something new.

It is possible to do keystroke input.

Include (-
[ getRelevantKey key;
  while((key = VM_KeyChar()) == -4 or -5 or -10 or -11 or -12 or -13) continue;
  return key;
];
-).

To decide what unicode character is get key: (- getRelevantKey() -).

To decide what text is the key input: decide on the substituted form of "[get key]" in lower case.

when play begins: 
while true is true begin;
  let t be the key input;
  say t;
  if t is "q", break;
end while;

6 Likes

I don’t understand anything about your solution, but it worked. :smile:

1 Like

I get that a lot, he says, humblebraggingly. :laughing:

2 Likes