Free Hero Mesh

Artifact [eb653d258c]
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.

Artifact eb653d258c581bfbe59100db44d92e1113e3c9a4:

Wiki page [keybindings] by zzo38 on 2018-10-22 05:04:16.
D 2018-10-22T05:04:16.971
L keybindings
P 0883cacbccd232579b5cc1c759b53a0b32d86441
U zzo38
W 4066
This document describes the format for defining key bindings and mouse bindings.

The resource name for a binding consists of:
  *  Puzzle set name
  *  One of <tt>editClick</tt>, <tt>editKey</tt>, <tt>gameClick</tt>, or <tt>gameKey</tt>
  *  Zero or more components for modifier keys: <tt>shift</tt>, <tt>ctrl</tt>, <tt>alt</tt>, <tt>meta</tt>, and/or <tt>numLock</tt> (you may not combine <tt>numLock</tt> with any other modifiers except <tt>shift</tt>)
  *  Key name (or mouse button)

You are not allowed to use <tt>?</tt> modifiers for the key name or mouse button or modifier keys, although you can use <tt>*</tt> anywhere, and <tt>?</tt> can be used in place of the first and/or second components.

If you define a binding without num lock but do not define the corresponding binding with num lock, then that key combination (or mouse button) will do the same thing when num lock is on than when num lock is not on.

The definition of a binding can be:
  *  Built-in miscellaneous
  *  Rewind
  *  Advance
  *  Reset
  *  Input a move
  *  External command
  *  SQL statement

<h2>Built-in miscellaneous</h2>
Consists of <tt>^</tt> followed by one more character.

(TODO: Mention what commands are available.)

<h2>Rewind/advance/reset</h2>
Consists of <tt>-</tt> to rewind, <tt>+</tt> to advance, or <tt>=</tt> to reset, followed by a nonnegative integer in decimal notation.

This will rewind or advance the move list, or reset the move list to the beginning. In the case of rewind or advance it tells how many moves to rewind or advance by. In case of reset, it specifies how many moves to advance after it is reset (normally you should specify zero).

These commands are not valid in the level editor.

<h2>Input a move</h2>
Consists of <tt>'</tt> followed by a [Hero Mesh key name].

This will begin a new game turn, and then record the move just made (unless the move is ignored with the IgnoreKey instruction, in which case the state of the game remains unchanged).

These commands are not valid in the level editor.

<h2>External command</h2>
Consists of <tt>!</tt> followed by a shell command.

Executes the given command and waits for it to return.

<h2>SQL statement</h2>
Consists of a single SQL statement (which must not begin with a comment). Only one SQL statement is allowed; you are not allowed more than one. The statement is prepared when Free Hero Mesh starts. The statement should be [http://sqlite.org/lang_analyze.html|ANALYZE], [http://sqlite.org/lang_delete.html|DELETE], [http://sqlite.org/lang_insert.html|INSERT], [http://sqlite.org/lang_select.html|SELECT], [http://sqlite.org/lang_update.html|UPDATE], or [http://sqlite.org/lang_vacuum.html|VACUUM]; use the sqlInit resource if you need to execute other statements.

The SQL statement will be executed when the key/mouse is pushed. If there are any result rows, they are interpreted as follows: The first column is a string consisting of exactly two characters, telling what operation should be performed; the rest of the columns are the arguments. Any extra arguments are ignored, although since later versions of Free Hero Mesh might use them for something, it is recommended to use null values in the extra columns for compatibility with future.

If there any host parameters, they are interpreted as follows (all case case-insensitive):
  *  $X = X coordinate in playfield
  *  $Y = Y coordinate in playfield
  *  $LEVEL = Level order number (same as LEVEL() function)
  *  $LEVEL_ID = Level ID number (same as LEVEL_ID() function)
  *  :anything = Any host parameter name that starts with a colon means it will ask you when the key is pushed. If you push ctrl+C at the prompt then the command is cancelled.

Note that $LEVEL and $LEVEL_ID keep the same values for the entire statement, even though LEVEL() and LEVEL_ID() may give a different value if a different level is selected half way in between.

See also [SQL tables] and [SQL functions]. Extensions may define additional tables/functions that can be used.

Z 2f2f06f54d4a089295db9e3d4a389ffa