You could set two constant clientside variables that monitor the player's LAST x and y coordinates in a system NPC and then do something like:
PHP Code:
//#CLIENTSIDE
function onKeyPressed()
{
for (dir = 0; dir < 4; dir++)
{
if (keydown(dir))
{
if (player.x != client.lastplayer_x || player.y != client.lastplayer_y)
{
//The player has moved!
}
}
}
}