Revert to a more conservative approach when mapping key events to scan codes
This commit is contained in:
parent
187318cebb
commit
b6984d348e
6 changed files with 67 additions and 47 deletions
|
|
@ -519,7 +519,7 @@ function Pj(a,b,c,d){if(S[b]){var e=Math.floor(b/1E3)&2;if(b=Jj[b]||0){!e||b&85|
|
|||
function Oj(a,b,c){if(S[b]&&a.T&&a.T.ma.nb){Jj[b]&&a.Rb.length&&0<a.Rb[0].wd&&(a.Rb[0].wd=0);for(var d,e=0;e<a.Rb.length;e++)if(d=a.Rb[e],d.ye==b){if(!c||0<=d.wd){e=-1;break}0<e&&(0<a.Rb[0].wd&&(a.Rb[0].wd=0),a.Rb.splice(e,1));break}0>e||(e==a.Rb.length&&(d={},d.ye=b,d.Fb=a.Fb,Rj(a,b,!0),e++),0<e&&a.Rb.splice(0,0,d),d.mg=!0,d.wd=c?-1:Jj[b]?0:1,Sj(a,d))}}
|
||||
function Qj(a,b,c){if(!S[b]||!(c||a.T&&a.T.ma.nb))return!1;for(var d=!1,e=0;e<a.Rb.length;e++){var f=a.Rb[e];if(f.ye==b||f.ye==R[b]){a.Rb.splice(e,1);f.vm&&clearTimeout(f.vm);f.mg&&!c&&Tj(a,f.ye,!1);Rj(a,b,!1);d=!0;break}}!a.Rb.length&&a.Ni&&(Pj(a,1020),a.Ni=!1);return d}
|
||||
function Sj(a,b){if(a.T&&a.T.ma.nb){if(Tj(a,b.ye,b.mg),b.wd){var c;if(0>b.wd){if(!b.mg){Qj(a,b.ye);return}b.mg=!1;c=a.jo}else c=1==b.wd++?a.ko:a.lo;b.vm=setTimeout(function(a){return function(){Sj(a,b)}}(a),c)}}else Qj(a,b.ye,!0)}function Uj(a,b,c){var d=b;if(65<=b&&90>=b)!(a.Fb&515)==c&&(d=b+32);else if(97<=b&&122>=b)!!(a.Fb&515)==c&&(d=b-32);else if(!!(a.Fb&3)==c){if(a=R[b])d=a}else if(a=Ij[b])d=a;return d}k.Uh=function(a){this.xh=a;a||(this.Fb&=-256)};
|
||||
function Nj(a,b,c){var d=!0,e=!1,f=!1,g=b.keyCode,h=Uj(a,g,!0);a.Mk&&h==O["`"]&&(g=h=27);if(S[g+1E3])if(h+=1E3,2==b.location&&(h+=2E3),Pj(a,h,!1,c)){if(20==g||144==g||145==g)a.Vm||(c=e=!0);if(!(c||91!=g&&93!=g))for(var n=0;n<a.Rb.length;n++){var m=a.Rb[n];m.mg=!1;0<m.wd&&(m.wd=0)}}else 8==g&&8==(a.Fb&40)&&(h=4008),d=!1;else S[h]&&a.Fb&60&&(d=!1),f=!!(a.Fb&192);d||b.preventDefault();f||a.Pk&&d||(c?Oj(a,h,e):Qj(a,h)||(b=Uj(a,g,!1),b!=h&&Qj(a,b)));return d}
|
||||
function Nj(a,b,c){var d=!0,e=!1,f=!1,g=b.keyCode,h=Uj(a,g,!0);a.Mk&&h==O["`"]&&(g=h=27);if(S[g+1E3])if(h+=1E3,2==b.location&&(h+=2E3),Pj(a,h,!1,c)){if(20==g||144==g||145==g)a.Vm||(c=e=!0);if(!(c||91!=g&&93!=g))for(var n=0;n<a.Rb.length;n++){var m=a.Rb[n];m.mg=!1;0<m.wd&&(m.wd=0)}}else 8==g&&8==(a.Fb&40)&&(h=4008),d=!1;else S[h]&&a.Fb&60?d=!1:f=!0,a.Fb&192&&(f=!0);d||b.preventDefault();f||a.Pk&&d||(c?Oj(a,h,e):Qj(a,h)||(b=Uj(a,g,!1),b!=h&&Qj(a,b)));return d}
|
||||
function Tj(a,b,c){Pj(a,b,!0,c);var d=S[b]||S[b+1E3];if(void 0!==d){14==d&&40==(a.Fb&40)&&(d=83);var e=[],f=d&255;e.push(f|(c?0:128));for(b=65<=b&&90>=b||97<=b&&122>=b;d>>>=8;){var g=0,h=d&255;224==f||225==f?e.push(f|(c?0:128)):(42==h?a.Fb&3||a.Fb&512&&b||(g=h):29==h?a.Fb&12||(g=h):56==h?a.Fb&48||(g=h):e.push(f|(c?0:128)),g&&(c?e.unshift(g):e.push(g|128)))}for(c=0;c<e.length;c++)d=a,f=e[c],d.Xb&&(20>d.Xb.length?(d.ua()&&d.fb("scan code 0x"+q(f)+" buffered"),d.Xb.push(f),1==d.Xb.length&&d.oa&&zj(d.oa,
|
||||
f)):(20==d.Xb.length&&d.Xb.push(255),d.fb("scan code buffer overflow")))}}Ja(function(){for(var a=A(window.document,"pcjs","keyboard"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Hj(d);ab(d,c)}});
|
||||
function U(a,b,c,d){y.call(this,"Video",a,U,131072);this.Ka=a.model;this.dd=0;"ega"==this.Ka&&(this.qm=a.switches,this.dd=a.memory||0);this.vd=a.mode;if(void 0===this.vd||void 0===Vj[this.vd])this.vd=Wj;this.Mh=a.charCols;this.cj=a.charRows;if(void 0===this.Mh||void 0===this.cj)this.Mh=Vj[this.vd][0],this.cj=Vj[this.vd][1];this.Hd=a.screenWidth;this.ke=a.screenHeight;this.Wm=a.scale;this.Tm=12<=Math.round(this.Hd/this.Mh);this.Ym=a.touchScreen;this.fg=b;this.ed=c;this.Na=(this.zp=d)||b||null;this.qe=
|
||||
|
|
|
|||
|
|
@ -499,7 +499,7 @@ function Ui(a,b,c,d){if(T[b]){var e=Math.floor(b/1E3)&2;if(b=Oi[b]||0){!e||b&85|
|
|||
function Ti(a,b,c){if(T[b]&&a.ka&&a.ka.ma.Jb){Oi[b]&&a.Ib.length&&0<a.Ib[0].ad&&(a.Ib[0].ad=0);for(var d,e=0;e<a.Ib.length;e++)if(d=a.Ib[e],d.Xd==b){if(!c||0<=d.ad){e=-1;break}0<e&&(0<a.Ib[0].ad&&(a.Ib[0].ad=0),a.Ib.splice(e,1));break}0>e||(e==a.Ib.length&&(d={},d.Xd=b,d.ub=a.ub,Wi(a,b,!0),e++),0<e&&a.Ib.splice(0,0,d),d.Af=!0,d.ad=c?-1:Oi[b]?0:1,Xi(a,d))}}
|
||||
function Vi(a,b,c){if(!T[b]||!(c||a.ka&&a.ka.ma.Jb))return!1;for(var d=!1,e=0;e<a.Ib.length;e++){var f=a.Ib[e];if(f.Xd==b||f.Xd==S[b]){a.Ib.splice(e,1);f.Dl&&clearTimeout(f.Dl);f.Af&&!c&&Yi(a,f.Xd,!1);Wi(a,b,!1);d=!0;break}}!a.Ib.length&&a.Yh&&(Ui(a,1020),a.Yh=!1);return d}
|
||||
function Xi(a,b){if(a.ka&&a.ka.ma.Jb){if(Yi(a,b.Xd,b.Af),b.ad){var c;if(0>b.ad){if(!b.Af){Vi(a,b.Xd);return}b.Af=!1;c=a.nn}else c=1==b.ad++?a.on:a.pn;b.Dl=setTimeout(function(a){return function(){Xi(a,b)}}(a),c)}}else Vi(a,b.Xd,!0)}function Zi(a,b,c){var d=b;if(65<=b&&90>=b)!(a.ub&515)==c&&(d=b+32);else if(97<=b&&122>=b)!!(a.ub&515)==c&&(d=b-32);else if(!!(a.ub&3)==c){if(a=S[b])d=a}else if(a=Ni[b])d=a;return d}k.ih=function(a){this.Lg=a;a||(this.ub&=-256)};
|
||||
function Si(a,b,c){var d=!0,e=!1,f=!1,g=b.keyCode,h=Zi(a,g,!0);a.Tj&&h==P["`"]&&(g=h=27);if(T[g+1E3])if(h+=1E3,2==b.location&&(h+=2E3),Ui(a,h,!1,c)){if(20==g||144==g||145==g)a.dm||(c=e=!0);if(!(c||91!=g&&93!=g))for(var m=0;m<a.Ib.length;m++){var n=a.Ib[m];n.Af=!1;0<n.ad&&(n.ad=0)}}else 8==g&&8==(a.ub&40)&&(h=4008),d=!1;else T[h]&&a.ub&60&&(d=!1),f=!!(a.ub&192);d||b.preventDefault();f||a.Wj&&d||(c?Ti(a,h,e):Vi(a,h)||(b=Zi(a,g,!1),b!=h&&Vi(a,b)));return d}
|
||||
function Si(a,b,c){var d=!0,e=!1,f=!1,g=b.keyCode,h=Zi(a,g,!0);a.Tj&&h==P["`"]&&(g=h=27);if(T[g+1E3])if(h+=1E3,2==b.location&&(h+=2E3),Ui(a,h,!1,c)){if(20==g||144==g||145==g)a.dm||(c=e=!0);if(!(c||91!=g&&93!=g))for(var m=0;m<a.Ib.length;m++){var n=a.Ib[m];n.Af=!1;0<n.ad&&(n.ad=0)}}else 8==g&&8==(a.ub&40)&&(h=4008),d=!1;else T[h]&&a.ub&60?d=!1:f=!0,a.ub&192&&(f=!0);d||b.preventDefault();f||a.Wj&&d||(c?Ti(a,h,e):Vi(a,h)||(b=Zi(a,g,!1),b!=h&&Vi(a,b)));return d}
|
||||
function Yi(a,b,c){Ui(a,b,!0,c);var d=T[b]||T[b+1E3];if(void 0!==d){14==d&&40==(a.ub&40)&&(d=83);var e=[],f=d&255;e.push(f|(c?0:128));for(b=65<=b&&90>=b||97<=b&&122>=b;d>>>=8;){var g=0,h=d&255;224==f||225==f?e.push(f|(c?0:128)):(42==h?a.ub&3||a.ub&512&&b||(g=h):29==h?a.ub&12||(g=h):56==h?a.ub&48||(g=h):e.push(f|(c?0:128)),g&&(c?e.unshift(g):e.push(g|128)))}for(c=0;c<e.length;c++)d=a,f=e[c],d.Nb&&(20>d.Nb.length?(d.Nb.push(f),1==d.Nb.length&&d.la&&Fi(d.la,f)):(20==d.Nb.length&&d.Nb.push(255),d.hc("scan code buffer overflow")))}}
|
||||
za(function(){for(var a=y(window.document,"pcjs","keyboard"),b=0;b<a.length;b++){var c=a[b],d=x(c),d=new Mi(d);Na(d,c)}});
|
||||
function U(a,b,c,d){u.call(this,"Video",a,U);this.Ia=a.model;this.Nc=0;"ega"==this.Ia&&(this.yl=a.switches,this.Nc=a.memory||0);this.$c=a.mode;if(void 0===this.$c||void 0===V[this.$c])this.$c=$i;this.$g=a.charCols;this.qi=a.charRows;if(void 0===this.$g||void 0===this.qi)this.$g=V[this.$c][0],this.qi=V[this.$c][1];this.kd=a.screenWidth;this.Gd=a.screenHeight;this.em=a.scale;this.bm=12<=Math.round(this.kd/this.$g);this.gm=a.touchScreen;this.tf=b;this.Oc=c;this.Ga=(this.Eo=d)||b||null;this.Md=null;this.$l=
|
||||
|
|
|
|||
|
|
@ -166,47 +166,6 @@ if (typeof module !== 'undefined') {
|
|||
var Messages = require("./messages");
|
||||
}
|
||||
|
||||
/**
|
||||
* @class Sector
|
||||
* @property {number} sector
|
||||
* @property {number} length
|
||||
* @property {Array.<number>} data
|
||||
* @property {number|null} pattern
|
||||
* @property {number} iCylinder
|
||||
* @property {number} iHead
|
||||
* @property {number} iModify
|
||||
* @property {number} cModify
|
||||
*
|
||||
* Every Sector object (once loaded and fully parsed) should have ALL of the following named properties:
|
||||
*
|
||||
* 'sector': sector number
|
||||
* 'length': size of the sector, in bytes
|
||||
* 'data': array of dwords
|
||||
* 'pattern': dword pattern to use for empty or partial sectors (or null if sector still needs to be loaded)
|
||||
*
|
||||
* initSector() also sets the following properties, to help us quickly identify its location within aDiskData:
|
||||
*
|
||||
* iCylinder
|
||||
* iHead
|
||||
*
|
||||
* In addition, we will maintain the following information on a per-sector basis, as sectors are modified:
|
||||
*
|
||||
* iModify: index of first modified dword in sector
|
||||
* cModify: number of modified dwords in sector
|
||||
* fDirty: true if sector is dirty, false if clean (or cleaning in progress)
|
||||
*
|
||||
* fDirty is used in conjunction with "demandrw" disks; it is set to true whenever the sector is modified, and is
|
||||
* set to false whenever the sector has been sent to the server. If the server write succeeds and fDirty is still
|
||||
* false, then the sector modifications are removed (cModify is set to zero). If the write succeeds but fDirty was
|
||||
* set to true again in the meantime, then all the sector modifications (even those that were just written) remain
|
||||
* in place (since we don't keep track of more than one modification range within a sector). And if the write failed,
|
||||
* then fDirty is set back to true and again all modifications remain in place; the best we can do is schedule another
|
||||
* write attempt.
|
||||
*
|
||||
* TODO: Perhaps we should also maintain a failure count and stop trying to write sectors that reach a certain
|
||||
* threshold. Error-handling, as usual, is the thorniest problem.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Disk(controller, drive, mode)
|
||||
*
|
||||
|
|
@ -269,6 +228,57 @@ function Disk(controller, drive, mode)
|
|||
this.setReady();
|
||||
}
|
||||
|
||||
/**
|
||||
* @class File
|
||||
* @property {string} sPath
|
||||
* @property {string} sName
|
||||
* @property {number} bAttr
|
||||
* @property {number} cbSize
|
||||
* @property {Array.<number>} apba
|
||||
* @property {Disk} disk
|
||||
*/
|
||||
|
||||
/**
|
||||
* @class Sector
|
||||
* @property {number} sector
|
||||
* @property {number} length
|
||||
* @property {Array.<number>} data
|
||||
* @property {number|null} pattern
|
||||
* @property {number} iCylinder
|
||||
* @property {number} iHead
|
||||
* @property {number} iModify
|
||||
* @property {number} cModify
|
||||
*
|
||||
* Every Sector object (once loaded and fully parsed) should have ALL of the following named properties:
|
||||
*
|
||||
* 'sector': sector number
|
||||
* 'length': size of the sector, in bytes
|
||||
* 'data': array of dwords
|
||||
* 'pattern': dword pattern to use for empty or partial sectors (or null if sector still needs to be loaded)
|
||||
*
|
||||
* initSector() also sets the following properties, to help us quickly identify its location within aDiskData:
|
||||
*
|
||||
* iCylinder
|
||||
* iHead
|
||||
*
|
||||
* In addition, we will maintain the following information on a per-sector basis, as sectors are modified:
|
||||
*
|
||||
* iModify: index of first modified dword in sector
|
||||
* cModify: number of modified dwords in sector
|
||||
* fDirty: true if sector is dirty, false if clean (or cleaning in progress)
|
||||
*
|
||||
* fDirty is used in conjunction with "demandrw" disks; it is set to true whenever the sector is modified, and is
|
||||
* set to false whenever the sector has been sent to the server. If the server write succeeds and fDirty is still
|
||||
* false, then the sector modifications are removed (cModify is set to zero). If the write succeeds but fDirty was
|
||||
* set to true again in the meantime, then all the sector modifications (even those that were just written) remain
|
||||
* in place (since we don't keep track of more than one modification range within a sector). And if the write failed,
|
||||
* then fDirty is set back to true and again all modifications remain in place; the best we can do is schedule another
|
||||
* write attempt.
|
||||
*
|
||||
* TODO: Perhaps we should also maintain a failure count and stop trying to write sectors that reach a certain
|
||||
* threshold. Error-handling, as usual, is the thorniest problem.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @class SectorInfo
|
||||
* @property {number} 0 contains iCylinder
|
||||
|
|
|
|||
|
|
@ -2033,12 +2033,22 @@ Keyboard.prototype.onKeyDown = function(event, fDown)
|
|||
*/
|
||||
if (Keyboard.SIMCODES[simCode] && (this.bitsState & (Keyboard.STATE.CTRLS | Keyboard.STATE.ALTS))) {
|
||||
fPass = false;
|
||||
} else {
|
||||
/*
|
||||
* HACK: For all other keys (ie, keys not marked as ONDOWN, and non-CTRL/non-ALT combinations), we're
|
||||
* going to ignore their down/up events; even though that prevents those keys from being repeated properly
|
||||
* (ie, at the simulation's repeat rate rather than the browser's repeat rate), it's the safest thing to
|
||||
* do when dealing with international keyboards, because our mapping tables are designed for US keyboards,
|
||||
* and testing all the permutations of international keyboards and browsers is more work than I can take
|
||||
* on now. TODO: Dig into this some day.
|
||||
*/
|
||||
fIgnore = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* For now, we don't want to simulate any key sequence that has the CMD key associated with it.
|
||||
* For now, we also don't want to simulate any key sequence that has the CMD key associated with it.
|
||||
*/
|
||||
fIgnore = !!(this.bitsState & Keyboard.STATE.CMDS);
|
||||
if (!!(this.bitsState & Keyboard.STATE.CMDS)) fIgnore = true;
|
||||
}
|
||||
|
||||
if (!fPass) {
|
||||
|
|
|
|||
|
|
@ -519,7 +519,7 @@ function Pj(a,b,c,d){if(S[b]){var e=Math.floor(b/1E3)&2;if(b=Jj[b]||0){!e||b&85|
|
|||
function Oj(a,b,c){if(S[b]&&a.T&&a.T.ma.nb){Jj[b]&&a.Rb.length&&0<a.Rb[0].wd&&(a.Rb[0].wd=0);for(var d,e=0;e<a.Rb.length;e++)if(d=a.Rb[e],d.ye==b){if(!c||0<=d.wd){e=-1;break}0<e&&(0<a.Rb[0].wd&&(a.Rb[0].wd=0),a.Rb.splice(e,1));break}0>e||(e==a.Rb.length&&(d={},d.ye=b,d.Fb=a.Fb,Rj(a,b,!0),e++),0<e&&a.Rb.splice(0,0,d),d.mg=!0,d.wd=c?-1:Jj[b]?0:1,Sj(a,d))}}
|
||||
function Qj(a,b,c){if(!S[b]||!(c||a.T&&a.T.ma.nb))return!1;for(var d=!1,e=0;e<a.Rb.length;e++){var f=a.Rb[e];if(f.ye==b||f.ye==R[b]){a.Rb.splice(e,1);f.vm&&clearTimeout(f.vm);f.mg&&!c&&Tj(a,f.ye,!1);Rj(a,b,!1);d=!0;break}}!a.Rb.length&&a.Ni&&(Pj(a,1020),a.Ni=!1);return d}
|
||||
function Sj(a,b){if(a.T&&a.T.ma.nb){if(Tj(a,b.ye,b.mg),b.wd){var c;if(0>b.wd){if(!b.mg){Qj(a,b.ye);return}b.mg=!1;c=a.jo}else c=1==b.wd++?a.ko:a.lo;b.vm=setTimeout(function(a){return function(){Sj(a,b)}}(a),c)}}else Qj(a,b.ye,!0)}function Uj(a,b,c){var d=b;if(65<=b&&90>=b)!(a.Fb&515)==c&&(d=b+32);else if(97<=b&&122>=b)!!(a.Fb&515)==c&&(d=b-32);else if(!!(a.Fb&3)==c){if(a=R[b])d=a}else if(a=Ij[b])d=a;return d}k.Uh=function(a){this.xh=a;a||(this.Fb&=-256)};
|
||||
function Nj(a,b,c){var d=!0,e=!1,f=!1,g=b.keyCode,h=Uj(a,g,!0);a.Mk&&h==O["`"]&&(g=h=27);if(S[g+1E3])if(h+=1E3,2==b.location&&(h+=2E3),Pj(a,h,!1,c)){if(20==g||144==g||145==g)a.Vm||(c=e=!0);if(!(c||91!=g&&93!=g))for(var n=0;n<a.Rb.length;n++){var m=a.Rb[n];m.mg=!1;0<m.wd&&(m.wd=0)}}else 8==g&&8==(a.Fb&40)&&(h=4008),d=!1;else S[h]&&a.Fb&60&&(d=!1),f=!!(a.Fb&192);d||b.preventDefault();f||a.Pk&&d||(c?Oj(a,h,e):Qj(a,h)||(b=Uj(a,g,!1),b!=h&&Qj(a,b)));return d}
|
||||
function Nj(a,b,c){var d=!0,e=!1,f=!1,g=b.keyCode,h=Uj(a,g,!0);a.Mk&&h==O["`"]&&(g=h=27);if(S[g+1E3])if(h+=1E3,2==b.location&&(h+=2E3),Pj(a,h,!1,c)){if(20==g||144==g||145==g)a.Vm||(c=e=!0);if(!(c||91!=g&&93!=g))for(var n=0;n<a.Rb.length;n++){var m=a.Rb[n];m.mg=!1;0<m.wd&&(m.wd=0)}}else 8==g&&8==(a.Fb&40)&&(h=4008),d=!1;else S[h]&&a.Fb&60?d=!1:f=!0,a.Fb&192&&(f=!0);d||b.preventDefault();f||a.Pk&&d||(c?Oj(a,h,e):Qj(a,h)||(b=Uj(a,g,!1),b!=h&&Qj(a,b)));return d}
|
||||
function Tj(a,b,c){Pj(a,b,!0,c);var d=S[b]||S[b+1E3];if(void 0!==d){14==d&&40==(a.Fb&40)&&(d=83);var e=[],f=d&255;e.push(f|(c?0:128));for(b=65<=b&&90>=b||97<=b&&122>=b;d>>>=8;){var g=0,h=d&255;224==f||225==f?e.push(f|(c?0:128)):(42==h?a.Fb&3||a.Fb&512&&b||(g=h):29==h?a.Fb&12||(g=h):56==h?a.Fb&48||(g=h):e.push(f|(c?0:128)),g&&(c?e.unshift(g):e.push(g|128)))}for(c=0;c<e.length;c++)d=a,f=e[c],d.Xb&&(20>d.Xb.length?(d.ua()&&d.fb("scan code 0x"+q(f)+" buffered"),d.Xb.push(f),1==d.Xb.length&&d.oa&&zj(d.oa,
|
||||
f)):(20==d.Xb.length&&d.Xb.push(255),d.fb("scan code buffer overflow")))}}Ja(function(){for(var a=A(window.document,"pcjs","keyboard"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Hj(d);ab(d,c)}});
|
||||
function U(a,b,c,d){y.call(this,"Video",a,U,131072);this.Ka=a.model;this.dd=0;"ega"==this.Ka&&(this.qm=a.switches,this.dd=a.memory||0);this.vd=a.mode;if(void 0===this.vd||void 0===Vj[this.vd])this.vd=Wj;this.Mh=a.charCols;this.cj=a.charRows;if(void 0===this.Mh||void 0===this.cj)this.Mh=Vj[this.vd][0],this.cj=Vj[this.vd][1];this.Hd=a.screenWidth;this.ke=a.screenHeight;this.Wm=a.scale;this.Tm=12<=Math.round(this.Hd/this.Mh);this.Ym=a.touchScreen;this.fg=b;this.ed=c;this.Na=(this.zp=d)||b||null;this.qe=
|
||||
|
|
|
|||
|
|
@ -499,7 +499,7 @@ function Ui(a,b,c,d){if(T[b]){var e=Math.floor(b/1E3)&2;if(b=Oi[b]||0){!e||b&85|
|
|||
function Ti(a,b,c){if(T[b]&&a.ka&&a.ka.ma.Jb){Oi[b]&&a.Ib.length&&0<a.Ib[0].ad&&(a.Ib[0].ad=0);for(var d,e=0;e<a.Ib.length;e++)if(d=a.Ib[e],d.Xd==b){if(!c||0<=d.ad){e=-1;break}0<e&&(0<a.Ib[0].ad&&(a.Ib[0].ad=0),a.Ib.splice(e,1));break}0>e||(e==a.Ib.length&&(d={},d.Xd=b,d.ub=a.ub,Wi(a,b,!0),e++),0<e&&a.Ib.splice(0,0,d),d.Af=!0,d.ad=c?-1:Oi[b]?0:1,Xi(a,d))}}
|
||||
function Vi(a,b,c){if(!T[b]||!(c||a.ka&&a.ka.ma.Jb))return!1;for(var d=!1,e=0;e<a.Ib.length;e++){var f=a.Ib[e];if(f.Xd==b||f.Xd==S[b]){a.Ib.splice(e,1);f.Dl&&clearTimeout(f.Dl);f.Af&&!c&&Yi(a,f.Xd,!1);Wi(a,b,!1);d=!0;break}}!a.Ib.length&&a.Yh&&(Ui(a,1020),a.Yh=!1);return d}
|
||||
function Xi(a,b){if(a.ka&&a.ka.ma.Jb){if(Yi(a,b.Xd,b.Af),b.ad){var c;if(0>b.ad){if(!b.Af){Vi(a,b.Xd);return}b.Af=!1;c=a.nn}else c=1==b.ad++?a.on:a.pn;b.Dl=setTimeout(function(a){return function(){Xi(a,b)}}(a),c)}}else Vi(a,b.Xd,!0)}function Zi(a,b,c){var d=b;if(65<=b&&90>=b)!(a.ub&515)==c&&(d=b+32);else if(97<=b&&122>=b)!!(a.ub&515)==c&&(d=b-32);else if(!!(a.ub&3)==c){if(a=S[b])d=a}else if(a=Ni[b])d=a;return d}k.ih=function(a){this.Lg=a;a||(this.ub&=-256)};
|
||||
function Si(a,b,c){var d=!0,e=!1,f=!1,g=b.keyCode,h=Zi(a,g,!0);a.Tj&&h==P["`"]&&(g=h=27);if(T[g+1E3])if(h+=1E3,2==b.location&&(h+=2E3),Ui(a,h,!1,c)){if(20==g||144==g||145==g)a.dm||(c=e=!0);if(!(c||91!=g&&93!=g))for(var m=0;m<a.Ib.length;m++){var n=a.Ib[m];n.Af=!1;0<n.ad&&(n.ad=0)}}else 8==g&&8==(a.ub&40)&&(h=4008),d=!1;else T[h]&&a.ub&60&&(d=!1),f=!!(a.ub&192);d||b.preventDefault();f||a.Wj&&d||(c?Ti(a,h,e):Vi(a,h)||(b=Zi(a,g,!1),b!=h&&Vi(a,b)));return d}
|
||||
function Si(a,b,c){var d=!0,e=!1,f=!1,g=b.keyCode,h=Zi(a,g,!0);a.Tj&&h==P["`"]&&(g=h=27);if(T[g+1E3])if(h+=1E3,2==b.location&&(h+=2E3),Ui(a,h,!1,c)){if(20==g||144==g||145==g)a.dm||(c=e=!0);if(!(c||91!=g&&93!=g))for(var m=0;m<a.Ib.length;m++){var n=a.Ib[m];n.Af=!1;0<n.ad&&(n.ad=0)}}else 8==g&&8==(a.ub&40)&&(h=4008),d=!1;else T[h]&&a.ub&60?d=!1:f=!0,a.ub&192&&(f=!0);d||b.preventDefault();f||a.Wj&&d||(c?Ti(a,h,e):Vi(a,h)||(b=Zi(a,g,!1),b!=h&&Vi(a,b)));return d}
|
||||
function Yi(a,b,c){Ui(a,b,!0,c);var d=T[b]||T[b+1E3];if(void 0!==d){14==d&&40==(a.ub&40)&&(d=83);var e=[],f=d&255;e.push(f|(c?0:128));for(b=65<=b&&90>=b||97<=b&&122>=b;d>>>=8;){var g=0,h=d&255;224==f||225==f?e.push(f|(c?0:128)):(42==h?a.ub&3||a.ub&512&&b||(g=h):29==h?a.ub&12||(g=h):56==h?a.ub&48||(g=h):e.push(f|(c?0:128)),g&&(c?e.unshift(g):e.push(g|128)))}for(c=0;c<e.length;c++)d=a,f=e[c],d.Nb&&(20>d.Nb.length?(d.Nb.push(f),1==d.Nb.length&&d.la&&Fi(d.la,f)):(20==d.Nb.length&&d.Nb.push(255),d.hc("scan code buffer overflow")))}}
|
||||
za(function(){for(var a=y(window.document,"pcjs","keyboard"),b=0;b<a.length;b++){var c=a[b],d=x(c),d=new Mi(d);Na(d,c)}});
|
||||
function U(a,b,c,d){u.call(this,"Video",a,U);this.Ia=a.model;this.Nc=0;"ega"==this.Ia&&(this.yl=a.switches,this.Nc=a.memory||0);this.$c=a.mode;if(void 0===this.$c||void 0===V[this.$c])this.$c=$i;this.$g=a.charCols;this.qi=a.charRows;if(void 0===this.$g||void 0===this.qi)this.$g=V[this.$c][0],this.qi=V[this.$c][1];this.kd=a.screenWidth;this.Gd=a.screenHeight;this.em=a.scale;this.bm=12<=Math.round(this.kd/this.$g);this.gm=a.touchScreen;this.tf=b;this.Oc=c;this.Ga=(this.Eo=d)||b||null;this.Md=null;this.$l=
|
||||
|
|
|
|||
Loading…
Reference in a new issue