Just a wild guess but try to put the "mouse_map = ..." part out of the if comparison (basically just delete the if-comparison). It shouldn't be necessary.