Priority System
When you cast a spell, fire an arrow, or when an enemy comes into view during the enemy's turn, or when a trap is sprung, you gain priority. This is indicated by a green bar at the bottom of the screen, and the addition of an event to the "Spells & Arrows" column. You can then 1) press ENTER to try and resolve the event OR 2) queue up additional events.
While you have priority, you may cast additional spells, fire more arrows, or perform a small set of other actions (for example, if the Rogue has the quick draw skill, he may wield a bow or knife, and the mage may turn a page of her spellbook). If you perform any of these actions while you have priority, you will maintain priority. The number of actions you can perform is limited only by concerns such as the amount of magic you have available, or the firing rate of your bow (and also by the fact that you can only perform this limited set of "instant" actions: you can't move, or get items, for example). Once you've decided to stop performing actions, you must yield priority to attempt to start resolving the events that you've queued up.
To yield priority, press ENTER. When you yield priority, if you didn't queue up any events since the last time you gained priority, then the first event will resolve. Otherwise, if you have queued up events, then enemies will once again get a chance to queue up some additional events if they can and want to do this (i.e., they can respond to your responses).
The bottom line of the mechanic is just this: whenever you have priority, do as many actions as you want and can do, and then start pressing ENTER to resolve them one at a time. Each time you press ENTER, either the event will resolve, OR an additional event may be queued up (the latter will happen if an enemy responds to your event). IF you want & can respond to that additional event, do so, otherwise just keep pressing enter.
Example: It is your turn, and Mage casts magic missile targeting a goblin shaman (press c, select magic missile by pressing the corresponding number key or by clicking on "magic missile" with the mouse, then select goblin shaman with the mouse). You gain priority. You try to resolve the magic missile (press ENTER). Then, instead of allowing your magic missile to resolve, the goblin shaman casts counterspell targeting your magic missile. Now, you will once again gain priority and the "Spells & Arrows" column will display "magic missile" and "counterspell". If you move your mouse over "counterspell" you can see that it is targeting "magic missile" (this is also indicated in a message). You can try to cast a counterspell of your own targeting the goblin shaman's counterspell, but maybe you don't have enough available magic. That means you'll have to let the goblin shaman's counterspell resolve (press ENTER). The counterspell resolves and the magic missile is countered. Now there are no events on the stack, and your turn resumes normally.
Spellbook Manipulation
Every magic user has a spellbook with a certain number of pages (Mage's spellbook starts with three pages). The runes of 3 or 4 spells are written on each page. If a magic user has enough available magic, he or she can cast spells from the page that the spellbook is currently open to (press c). The amount of available magic required (the magic cost) of a spell is written next to the name of the spell in all menus, indicated by a number of plus signs.
If there are no spells left on the current page of a magic users' spellbook, or if none of the spells are currently useful, the magic user can turn to the next page of their spellbook (press t). This can be done instantly, but usually only once per turn. Magic users can never turn back to previous pages of their spellbook, although there are some ways in which the previous pages can be recovered (for example, if Mage is on the last page of her spellbook, and a paper monster lands an attack on her, the last page of her spellbook will be destroyed, and she will now have her spellbook open to the second last page).
There are several ways to add pages to a spellbook, for example by casting spellbind. This spell targets a scroll that the caster is currently carrying, and binds the scroll to the end of the caster's spellbook. This new page will now carry up to 4 copies of the spell inscribed on the scroll. The precise number of copies depends on the magic users' level, and the level of the scroll being bound.
Some spells and effects can cause the pages of a spellbook to be reordered, or the contents of a page of a spellbook to be changed. Combining this with spellbinding allows magic users to efficiently cast the spells they desire.
Full Commands
ARROWS/ijkl - move
o - open door
O - close door
w - wield
W - stop wielding
a - wear
A - stop wearing
x - shoot
d - disarm trap
g or , - get item
c - cast spell
r - read scroll
t - turn page of spellbook
G - drop item
SPACE - end turn
TAB - next character
SHIFT+TAB - previous character
RETURN - yield priority (lower green bar = you have priority)
DELETE - show inventory/statistics
~ - view message backlog
? - help (this menu)
F1 - main menu
Ctrl+VI - toggle vi movement
Ctrl+C - quit