First you were talking about dragging a sprite, now about moving the player by keyboard..
Please explain what is the difference between the sprite, the player and the solid blocks..
Should be something simple as, is overlapping set back to original position, or is not overlapping at offset move to the position, but I don't know in what way your code is set up to do the movement..