The key "A" makes the character use a weapon to hit the closest enemy in view (melee or bow, depending on how far it is). If no enemy is in view and range, the character shoots the bow dead ahead, or if they haven't a bow, they don't do anything.
The key "S" makes the character to 1) cast a quick spell (if it is an attack spell, then it's aimed at the closest enemy, as with "A"), or, if you don't have any, 2) use the weapon as with "A".
(By the way, if you set area-of-effect spells as quick (like fireball), you can seriously hurt yourself, so take care. Ditto for wands with such spells.)
The archer uses the right weapon automatically. If the monsters are in melee range, the party will use their melee weapons. If they're not in melee range, but still in bow range, they will shoot bows at them.
You can jump a bit using "X". It's mostly useless, but the funny physics can make wonders. I remember a "New Sorpigal roof challenge" that I randomly came across — the task is to start on the roof of the inn and go over all the buildings in the New Sorpigal proper (not the temple and guilds, of course) using jumps only. And it's doable.