The map editor is in Picture mode (also known as "Tilemap mode").

F2 switch to picture mode
F3 switch to passability mode
F4 switch to door placement mode
F5 switch to NPC placement mode
F6 switch to foemap mode
F7 switch to zonemap mode

Use the arrow keys to move around the map.

Use SHIFT+arrow keys to move around the map faster.

Use ALT+arrow keys to move the view of the map.

Along the top of the screen you will see a row of maptiles, with your currently selected maptile highlighted. You can press < and > to change your selected maptile, or press ENTER to bring up a full-screen maptile picker.

Press G if you want to get the tile under the cursor as the current tile to place.

At the top right corner the current drawing tool is shown. Press SPACE to draw on the current map layer. The tools are:

D - Draw tool:
  Place a maptile on the map. Hold 
  down SPACE and move to draw lines.

B - Box tool:
  Press SPACE once to place one 
  corner of the box, and SPACE a 
  second time at the opposite corner 
  to draw a rectangle of tiles.

F - Fill (Paint bucket) tool:
  Flood fills a continuous region (on
  current layer) under the cursor 
  with the current tile.

R - Replace tool:
  Replaces completely across the 
  whole map layer all tiles like the 
  one under the cursor with the 
  current tile.

M - Mark tool:
  Use to select a rectangular of the
  map to copy. Press SPACE once to
  place one corner of the rectangle,
  and SPACE a second time at the
  opposite corner. The tool will then
  be changed to the Clone tool. Mark
  copies the visible tilemap layers,
  wallmap, foemap, and zones in the
  rectangle.

C - Clone tool:
  Press SPACE to paste a selection
  copied with the Mark tool.  You can
  switch to different editing modes
  to preview the changes to walls,
  foemap, and zones.  If default
  passability is on (press CTRL+D to
  toggle), the wallmap will updated
  using default walls instead of the
  copied walls.  Only visible map
  layers are modified (press ALT+~ to
  toggle visibility of the current
  map layer), so a map layer has to
  be visible both when Marking and
  when Cloning.

Also,

CTRL+Z undoes a change to the tilemap, wallmap, foemap or zonemap. Changes to NPCs and doors are not undoable. The undo history buffer is near-infinite, but certain things cause it to be cleared: resizing the map, deleting or swapping map layers, erasing map data, and leaving the map editor.

CTRL+Y redoes an undone change.

~ shows a preview of the entire map.

TAB toggles a blue rectangle that shows roughly what portion of the map you are currently looking at.

CTRL+H moves the hero's starting location to this location on this map. Remember that only one map in your game needs a hero starting location.

Press 1 or 2 to make the tile under the cursor animate using animation pattern 0 or 1.

Hold CTRL and press 1 or 2 to make all tiles on the current layer like the one under the cursor animate using animation pattern 0 or 1.

CTRL+D toggles whether default tile passability (which you assign to tiles in the tileset editor) will be used for any new tiles that you place.

CTRL+L opens the Layer menu, where you can change tilesets and layer visibility.

PageUp and PageDown change which layer you are working on. Remember that layer 0 is the bottommost. (You can also use CTRL+period and CTRL+comma in case you are one of those poor souls with a laptop that doesn't have PageUp and PageDown keys!)

CTRL+J makes the current layer jiggle. This can be useful to visually distinguish a layer you are working on from another layer that covers it up. Press CTRL+J again to stop the jiggling.

ALT+~ toggles visibility of the current map layer.

ALT+a number disables or enables that layer (you can't disable layer 0). Disabled layers aren't drawn while editing or playing.

CTRL+F# toggles visibility of a layer: F1 is layer 0, and so on.

CTRL+BACKSPACE deletes everything placed at a tile: tiles in all layers, walls, doors, and NPCs. But not zones.

CTRL+S immediately saves, useful when live-previewing a game.

CTRL+W paints the tiles visible in the window/screen with the current tile.

Any tiles that have the obsolete overhead bit set will be marked with O's if you are using multiple layers. This is normally a mistake: Use layers instead of `overhead' tiles!