code: function
  processModifiers(mods, val)
  {
  	var n = mod_jsprim.parseInteger(val);
  	if (n instanceof Error || n < 2 || n > 16) {
  		return;
  	}
  
  	n -= 1;
  
  	if ((n & 1) == 1) {
  		mods.shift = true;
  	}
  
  	if ((n & 2) == 2) {
  		mods.alt = true;
  	}
  
  	if ((n & 4) == 4) {
  		mods.control = true;
  	}
  
  	if ((n & 8) == 8) {
  		mods.meta = true;
  	}
  }
docs: /*
  For some inputs, the CSI sequence is followed by a number indicating
  the modifiers that were held during the keypress. These are:
  
  Code     Modifiers
  ---------+---------------------------
  2     | Shift
  3     | Alt
  4     | Shift + Alt
  5     | Control
  6     | Shift + Control
  7     | Alt + Control
  8     | Shift + Alt + Control
  9     | Meta
  10    | Meta + Shift
  11    | Meta + Alt
  12    | Meta + Alt + Shift
  13    | Meta + Ctrl
  14    | Meta + Ctrl + Shift
  15    | Meta + Ctrl + Alt
  16    | Meta + Ctrl + Alt + Shift
  ---------+---------------------------
  
  By substracting 1 from these values, we can treat them as a bitmask.