he took his hat off for a moment , then rescued a handkerchief from his inner pocket and used it to mop away some sweat , before putting the hat back on and tipping it up slightly , at a rakish angle .