Character detection fixes

gets insertion position, detects delete key