Allow pasted text in the virtual SerialPort window to be processed as received data, and tidy up the MMR0 updates

This commit is contained in:
Jeff 2016-11-16 13:54:10 -08:00 • committed by Jeff Parsons
commit 00d6fb6c59
7 changed files with 541 additions and 512 deletions

View file

@ -239,6 +239,15 @@ SerialPortPDP11.prototype.setBinding = function(sType, sBinding, control, sValue
return true;
};
control.onpaste = function onKeyPress(event) {
if (event.stopPropagation) event.stopPropagation();
if (event.preventDefault) event.preventDefault();
var clipboardData = event.clipboardData || window.clipboardData;
if (clipboardData) {
serial.receiveData(clipboardData.getData('Text'));
}
};
/*
* Now that we've added an onkeypress handler that calls preventDefault() for ALL keys, the control
* itself no longer needs the "readonly" attribute; we primarily need to remove it for iOS browsers,