HJKL keys

From Wikipedia, the free encyclopedia

HJKL keys are a method of navigating a cursor around the screen in a console program without using arrow keys or numpad. Popularized by their use in the vi text editor (originally written by Bill Joy on an ADM-3A terminal where arrows appeared over the h, j, k and l keys), these keys are also used in many roguelike games. Some early Apple II games used this setup prior to Apple's release of systems with arrow keys.

Contents

[edit] vi

In vi's command mode the HJKL keys do the following actions:

  • h moves the cursor left.
  • j moves the cursor down.
  • k moves the cursor up.
  • l moves the cursor right.

These keys are consistent with Ctrl-h for backspace (deleting the previous character, moving the cursor left) and Ctrl-j for line feed (moving the cursor to the next line), and on the ADM-3a terminal, Ctrl-k (vertical tab, meaning moving the cursor up) and Ctrl-l (moving the cursor non-destructively to the right).

[edit] Roguelikes

The HJKL keys were famously used in Rogue for moving the character, and many other roguelikes (like NetHack and Dungeon Crawl) have continued the tradition. Of course moving with arrow keys or numpad is also possible. For diagonal movement the following keys are used:

  • y for up-left
  • u for up-right
  • b for down-left
  • n for down-right

Also using these keys with Shift key makes the character run in that direction until something interrupts him/her.

These keys are also used in Robots.

[edit] StepMania

The game Dance Dance Revolution draws four columns of arrow marks in the order left, down, up, right. Some players of StepMania, a PC-based clone of Dance Dance Revolution, map their controls to HJKL to correspond directly to the order of the arrows.

[edit] Other uses

In the interactive fiction game The Gostak, which is in a made-up language, "kirf", "jirf", "hoff", "loff" correspond to north, south, west, east directions. They could be abbreviated as k,j,h,l. The diagonal directions are called "kiloff", "kihoff", "jiloff" and "jihoff".

[edit] See also