If you want to restrict the user to only the letters 'M', 'Q', or 'X', then you could use a combobox with those values. Alternately, adding this to the custom keystroke script for your text field would reject all other characters:
var re = /[mqxMQX]/
if (event.change.length >0) {
if (event.willCommit == false) {
if (re.test(event.change)) {
event.change = util.printx(">AA", event.change);
} else {
event.rc = false
}
}
}