All files keyboard.js

100% Statements 13/13
100% Branches 0/0
100% Functions 1/1
100% Lines 13/13

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 991x 2x         2x           2x                                             2x                                                                                 2x   2x   2x       2x 52x 52x         2x 20x            
var Keyboard = function(){
    this.is_mouse_down = false;
 
    /* keyboard behaviour definitions */
 
    // keys aside from 0-9,a-z,A-Z
    this.k_chars = {
	"+":"+",
	"-":"-",
	"*":"*",
	".":"."
    };
    this.k_text = {
	"/":"/",
	"*":"*",
	"(":"(",
	")":")",
	"<":"<",
	">":">",
	"|":"|",
	"!":"!",
	",":",",
	".":".",
	";":";",
	"=":"=",
	"[":"[",
	"]":"]",
	"@":"@",
	"'":"'",
	"`":"`",
	":":":",
	"\"":"\"",
	"?":"?",
	"space":" ",
    };
    this.k_controls = {
	"up":"up",
	"down":"down",
	"right":"right",
	"left":"left",
	"alt+k":"up",
	"alt+j":"down",
	"alt+l":"right",
	"alt+h":"left",
	"space":"spacebar",
	"home":"home",
	"end":"end",
	"backspace":"backspace",
	"del":"delete_key",
	"mod+a":"sel_all",
	"mod+c":"sel_copy",
	"mod+x":"sel_cut",
	"mod+v":"sel_paste",
	"mod+z":"undo",
	"mod+y":"redo",
	"enter":"done",
	"mod+shift+right":"list_extend_copy_right",
	"mod+shift+left":"list_extend_copy_left",
	",":"list_extend_right",
	";":"list_extend_down",
	"mod+right":"list_extend_right",
	"mod+left":"list_extend_left",
	"mod+up":"list_extend_up",
	"mod+down":"list_extend_down",
	"mod+shift+up":"list_extend_copy_up",
	"mod+shift+down":"list_extend_copy_down",
	"mod+backspace":"list_remove",
	"mod+shift+backspace":"list_remove_row",
	"shift+left":"sel_left",
	"shift+right":"sel_right",
	")":"right_paren",
	"\\":"backslash",
	"tab":"tab"
    };
 
    // Will populate keyboard shortcuts for symbols from symbol files
    this.k_syms = {};
 
    this.k_raw = "mod+space";
    
    var i = 0;
 
    // letters
 
    for(i = 65; i <= 90; i++){
	this.k_chars[String.fromCharCode(i).toLowerCase()] = String.fromCharCode(i).toLowerCase();
	this.k_chars['shift+'+String.fromCharCode(i).toLowerCase()] = String.fromCharCode(i).toUpperCase();
    }
 
    // numbers
 
    for(i = 48; i <= 57; i++)
	this.k_chars[String.fromCharCode(i)] = String.fromCharCode(i);
 
}
 
 
export default Keyboard;