var cseq : ClientSeq = 0;
var ctoken : string;
var uo_map : { [k: string]: UoRecord | null } = Object.create(null);
-var keyops_pieces : { [opname: string]: (uo: UoRecord) => void } = Object();
+var keyops_local : { [opname: string]: (uo: UoRecord) => void } = Object();
var svg_ns : string;
var space : SVGGraphicsElement;
var logdiv : HTMLElement;
var status_node : HTMLElement;
var uos_node : HTMLElement;
+var wresting: boolean;
const uo_kind_prec : { [kind: string]: number } = {
'GlobalExtra' : 50,
def_key: 'W',
kind: 'ClientExtra',
opname: 'wrest',
- desc: 'Enter wresting mode',
+ desc: wresting ? 'Exit wresting mode' : 'Enter wresting mode',
wrc: 'Predictable',
});
var uo_keys = Object.keys(uo_map);
console.log('KEY UO', e, uo);
if (uo.kind == 'Client' || uo.kind == 'ClientExtra') {
- let f = keyops_pieces[uo.opname];
+ let f = keyops_local[uo.opname];
// xxx 'wrest'
// xxx 'lower'
f(uo);
}
}
+keyops_local['wrest'] = function (uo: UoRecord) {
+ wresting = !wresting;
+ document.getElementById('wresting-warning')!.innerHTML = !wresting ? "" :
+ " <strong>(wresting mode!)</strong>";
+ recompute_keybindings();
+}
+
// ----- clicking/dragging pieces -----
type DragInfo = {