Problem: Cannot detect whether modifyOtherKeys is enabled.
Solution: Use XTQMODKEYS introduced by xterm version 377 to request the
modifyOtherKeys level. Update the keycode check results.
Problem: Code for modeless selection not sufficiently tested.
Solution: Add tests. Move mouse code functionality to a common script file.
(Yegappan Lakshmanan, closes#5821)