Difference between revisions of "Key Codes"

From WebOS Internals
Jump to: navigation, search
(New page: Found in: <pre><nowiki> /usr/palm/frameworks/mojo/submissions/175.7/javascripts/keycodes.js </nowiki></pre> That file has the key codes for the keys on the keyboard: <pre><nowiki> Mojo...)
 
 
Line 2: Line 2:
  
 
<pre><nowiki>
 
<pre><nowiki>
/usr/palm/frameworks/mojo/submissions/175.7/javascripts/keycodes.js
+
/usr/palm/frameworks/mojo/submissions/200.18/javascripts/keycodes.js
 
</nowiki></pre>
 
</nowiki></pre>
  
Line 8: Line 8:
  
 
<pre><nowiki>
 
<pre><nowiki>
Mojo.Char.backspace = 8;
+
/**
Mojo.Char.tab = 9;
+
* @name keycodes.js
Mojo.Char.enter = 13;
+
* @fileOverview This file has character code value
Mojo.Char.shift = 16;
+
 
Mojo.Char.opt = 17;
+
Copyright 2009 Palm, Inc.  All rights reserved.
Mojo.Char.ctrl = 17;
+
 
Mojo.Char.altKey = 18;
+
*/
Mojo.Char.pause = 19;
+
/**
Mojo.Char.breakKey = 19;
+
@namespace Holds character code value (Refer to the actual source for values) and some useful key code checking methods.
Mojo.Char.capsLock = 20;
+
@description
Mojo.Char.escape = 27;
+
Holds character code value (Refer to the actual source for values) and some useful key code checking methods.
Mojo.Char.spaceBar = 32;
+
*/
Mojo.Char.pageUp = 33;
+
 
Mojo.Char.pageDown = 34;
+
Mojo.Char = {};
Mojo.Char.end = 35;
+
 
Mojo.Char.home = 36;
+
Mojo.Char.backspace = 8;
Mojo.Char.leftArrow = 37;
+
Mojo.Char.tab = 9;
Mojo.Char.upArrow = 38;
+
Mojo.Char.enter = 13;
Mojo.Char.rightArrow = 39;
+
Mojo.Char.shift = 16;
Mojo.Char.downArrow = 40;
+
Mojo.Char.opt = 17;
Mojo.Char.insert = 45;
+
Mojo.Char.ctrl = 17;
Mojo.Char.deleteKey = 46;
+
Mojo.Char.sym      = 17;
Mojo.Char.zero = 48;
+
Mojo.Char.altKey = 18;
Mojo.Char.one = 49;
+
Mojo.Char.pause = 19;
Mojo.Char.two = 50;
+
Mojo.Char.breakKey = 19;
Mojo.Char.three = 51;
+
Mojo.Char.capsLock = 20;
Mojo.Char.four = 52;
+
Mojo.Char.escape = 27;
Mojo.Char.five = 53;
+
Mojo.Char.spaceBar = 32;
Mojo.Char.six = 54;
+
Mojo.Char.pageUp = 33;
Mojo.Char.seven = 55;
+
Mojo.Char.pageDown = 34;
Mojo.Char.eight = 56;
+
Mojo.Char.end = 35;
Mojo.Char.nine = 57;
+
Mojo.Char.home = 36;
Mojo.Char.a = 65;
+
Mojo.Char.leftArrow = 37;
Mojo.Char.b = 66;
+
Mojo.Char.upArrow = 38;
Mojo.Char.c = 67;
+
Mojo.Char.rightArrow= 39;
Mojo.Char.d = 68;
+
Mojo.Char.downArrow = 40;
Mojo.Char.e = 69;
+
Mojo.Char.insert = 45;
Mojo.Char.f = 70;
+
Mojo.Char.deleteKey = 46;
Mojo.Char.g = 71;
+
Mojo.Char.zero= 48;
Mojo.Char.h = 72;
+
Mojo.Char.one= 49;
Mojo.Char.i = 73;
+
Mojo.Char.two= 50;
Mojo.Char.j = 74;
+
Mojo.Char.three=51;
Mojo.Char.k = 75;
+
Mojo.Char.four= 52;
Mojo.Char.l = 76;
+
Mojo.Char.five= 53;
Mojo.Char.m = 77;
+
Mojo.Char.six= 54;
Mojo.Char.n = 78;
+
Mojo.Char.seven= 55;
Mojo.Char.o = 79;
+
Mojo.Char.eight= 56;
Mojo.Char.p = 80;
+
Mojo.Char.nine= 57;
Mojo.Char.q = 81;
+
Mojo.Char.a= 65;
Mojo.Char.r = 82;
+
Mojo.Char.b= 66;
Mojo.Char.s = 83;
+
Mojo.Char.c= 67;
Mojo.Char.t = 84;
+
Mojo.Char.d= 68;
Mojo.Char.u = 85;
+
Mojo.Char.e= 69;
Mojo.Char.v = 86;
+
Mojo.Char.f= 70;
Mojo.Char.w = 87;
+
Mojo.Char.g= 71;
Mojo.Char.x = 88;
+
Mojo.Char.h= 72;
Mojo.Char.y = 89;
+
Mojo.Char.i= 73;
Mojo.Char.z = 90;
+
Mojo.Char.j= 74;
 +
Mojo.Char.k= 75;
 +
Mojo.Char.l= 76;
 +
Mojo.Char.m= 77;
 +
Mojo.Char.n= 78;
 +
Mojo.Char.o= 79;
 +
Mojo.Char.p= 80;
 +
Mojo.Char.q= 81;
 +
Mojo.Char.r= 82;
 +
Mojo.Char.s= 83;
 +
Mojo.Char.t= 84;
 +
Mojo.Char.u= 85;
 +
Mojo.Char.v= 86;
 +
Mojo.Char.w= 87;
 +
Mojo.Char.x= 88;
 +
Mojo.Char.y= 89;
 +
Mojo.Char.z= 90;
 
Mojo.Char.leftWindowKey= 91;
 
Mojo.Char.leftWindowKey= 91;
 
Mojo.Char.rightWindowKey= 92;
 
Mojo.Char.rightWindowKey= 92;
Mojo.Char.selectKey = 93;
+
Mojo.Char.selectKey= 93;
Mojo.Char.numpad0 = 96;
+
Mojo.Char.numpad0= 96;
Mojo.Char.numpad1 = 97;
+
Mojo.Char.numpad1= 97;
Mojo.Char.numpad2 = 98;
+
Mojo.Char.numpad2= 98;
Mojo.Char.numpad3 = 99;
+
Mojo.Char.numpad3= 99;
Mojo.Char.numpad4 = 100;
+
Mojo.Char.numpad4= 100;
Mojo.Char.numpad5 = 101;
+
Mojo.Char.numpad5= 101;
Mojo.Char.numpad6 = 102;
+
Mojo.Char.numpad6= 102;
Mojo.Char.numpad7 = 103;
+
Mojo.Char.numpad7= 103;
Mojo.Char.numpad8 = 104;
+
Mojo.Char.numpad8= 104;
Mojo.Char.numpad9 = 105;
+
Mojo.Char.numpad9= 105;
Mojo.Char.multiply = 106;
+
Mojo.Char.multiply= 106;
Mojo.Char.add = 107;
+
Mojo.Char.add= 107;
Mojo.Char.subtract = 109;
+
Mojo.Char.subtract= 109;
Mojo.Char.decimalPoint = 110;
+
Mojo.Char.decimalPoint= 110;
Mojo.Char.divide = 111;
+
Mojo.Char.divide= 111;
Mojo.Char.f1 = 112;
+
Mojo.Char.f1= 112;
Mojo.Char.f2 = 113;
+
Mojo.Char.f2= 113;
Mojo.Char.f3 = 114;
+
Mojo.Char.f3= 114;
Mojo.Char.f4 = 115;
+
Mojo.Char.f4= 115;
Mojo.Char.f5 = 116;
+
Mojo.Char.f5= 116;
Mojo.Char.f6 = 117;
+
Mojo.Char.f6= 117;
Mojo.Char.f7 = 118;
+
Mojo.Char.f7= 118;
Mojo.Char.f8 = 119;
+
Mojo.Char.f8= 119;
Mojo.Char.f9 = 120;
+
Mojo.Char.f9= 120;
Mojo.Char.f10 = 121;
+
Mojo.Char.f10= 121;
Mojo.Char.f11 = 122;
+
Mojo.Char.f11= 122;
Mojo.Char.f12 = 123;
+
Mojo.Char.f12= 123;
Mojo.Char.numLock = 144;
+
Mojo.Char.numLock= 144;
Mojo.Char.scrollLock = 145;
+
Mojo.Char.scrollLock= 145;
Mojo.Char.semiColon = 186;
+
Mojo.Char.semiColon= 186;
Mojo.Char.equalSign = 187;
+
Mojo.Char.equalSign= 187;
Mojo.Char.comma = 188;
+
Mojo.Char.comma= 188;
Mojo.Char.dash = 189;
+
Mojo.Char.dash= 189;
Mojo.Char.period = 190;
+
Mojo.Char.period= 190;
Mojo.Char.forwardSlash = 191;
+
Mojo.Char.forwardSlash= 191;
Mojo.Char.graveAccent = 192;
+
Mojo.Char.graveAccent= 192;
Mojo.Char.openBracket = 219;
+
Mojo.Char.openBracket= 219;
Mojo.Char.backSlash = 220;
+
Mojo.Char.backSlash= 220;
Mojo.Char.closeBracket = 221;
+
Mojo.Char.closeBracket= 221;
Mojo.Char.singleQuote = 222;
+
Mojo.Char.singleQuote= 222;
 +
 
 +
Mojo.Char.metaKey = 231; //NEED THIS FOR META CUT/ COPY/ PASTE
  
Mojo.Char.metaKey = 231; //NEED THIS FOR META CUT/ COPY/ PASTE
 
  
Mojo.Char.asciiZero = 48;
+
Mojo.Char.asciiZero = 48;
Mojo.Char.asciiNine = 57;
+
Mojo.Char.asciiNine = 57;
 
</nowiki></pre>
 
</nowiki></pre>
  
 
It also has several useful functions such as 'isEnterKey()' and 'isDeleteKey()'
 
It also has several useful functions such as 'isEnterKey()' and 'isDeleteKey()'

Latest revision as of 09:52, 24 October 2009

Found in:

/usr/palm/frameworks/mojo/submissions/200.18/javascripts/keycodes.js

That file has the key codes for the keys on the keyboard:

/**
* @name keycodes.js
* @fileOverview This file has character code value

Copyright 2009 Palm, Inc.  All rights reserved.

*/
/**
@namespace Holds character code value (Refer to the actual source for values) and some useful key code checking methods.
@description 
Holds character code value (Refer to the actual source for values) and some useful key code checking methods.
*/

Mojo.Char = {};

Mojo.Char.backspace	=  8;
Mojo.Char.tab		=  9;
Mojo.Char.enter		= 13;
Mojo.Char.shift		= 16;
Mojo.Char.opt		= 17;
Mojo.Char.ctrl		= 17;
Mojo.Char.sym       = 17;
Mojo.Char.altKey	= 18;
Mojo.Char.pause		= 19;
Mojo.Char.breakKey	= 19;
Mojo.Char.capsLock	= 20;
Mojo.Char.escape	= 27;
Mojo.Char.spaceBar	= 32;
Mojo.Char.pageUp	= 33;
Mojo.Char.pageDown	= 34;
Mojo.Char.end		= 35;
Mojo.Char.home		= 36;
Mojo.Char.leftArrow	= 37;
Mojo.Char.upArrow	= 38;
Mojo.Char.rightArrow= 39;
Mojo.Char.downArrow	= 40;
Mojo.Char.insert	= 45;
Mojo.Char.deleteKey = 46;
Mojo.Char.zero= 48;
Mojo.Char.one= 49;
Mojo.Char.two= 50;
Mojo.Char.three=51;
Mojo.Char.four=	52;
Mojo.Char.five=	53;
Mojo.Char.six=	54;
Mojo.Char.seven=	55;
Mojo.Char.eight=	56;
Mojo.Char.nine=	57;
Mojo.Char.a=	65;
Mojo.Char.b=	66;
Mojo.Char.c=	67;
Mojo.Char.d=	68;
Mojo.Char.e=	69;
Mojo.Char.f=	70;
Mojo.Char.g=	71;
Mojo.Char.h=	72;
Mojo.Char.i=	73;
Mojo.Char.j=	74;
Mojo.Char.k=	75;
Mojo.Char.l=	76;
Mojo.Char.m=	77;
Mojo.Char.n=	78;
Mojo.Char.o=	79;
Mojo.Char.p=	80;
Mojo.Char.q=	81;
Mojo.Char.r=	82;
Mojo.Char.s=	83;
Mojo.Char.t=	84;
Mojo.Char.u=	85;
Mojo.Char.v=	86;
Mojo.Char.w=	87;
Mojo.Char.x=	88;
Mojo.Char.y=	89;
Mojo.Char.z=	90;
Mojo.Char.leftWindowKey=	91;
Mojo.Char.rightWindowKey=	92;
Mojo.Char.selectKey=	93;
Mojo.Char.numpad0=	96;
Mojo.Char.numpad1=	97;
Mojo.Char.numpad2=	98;
Mojo.Char.numpad3=	99;
Mojo.Char.numpad4=	100;
Mojo.Char.numpad5=	101;
Mojo.Char.numpad6=	102;
Mojo.Char.numpad7=	103;
Mojo.Char.numpad8=	104;
Mojo.Char.numpad9=	105;
Mojo.Char.multiply=	106;
Mojo.Char.add=	107;
Mojo.Char.subtract=	109;
Mojo.Char.decimalPoint=	110;
Mojo.Char.divide=	111;
Mojo.Char.f1=	112;
Mojo.Char.f2=	113;
Mojo.Char.f3=	114;
Mojo.Char.f4=	115;
Mojo.Char.f5=	116;
Mojo.Char.f6=	117;
Mojo.Char.f7=	118;
Mojo.Char.f8=	119;
Mojo.Char.f9=	120;
Mojo.Char.f10=	121;
Mojo.Char.f11=	122;
Mojo.Char.f12=	123;
Mojo.Char.numLock=	144;
Mojo.Char.scrollLock=	145;
Mojo.Char.semiColon=	186;
Mojo.Char.equalSign=	187;
Mojo.Char.comma=	188;
Mojo.Char.dash=	189;
Mojo.Char.period=	190;
Mojo.Char.forwardSlash=	191;
Mojo.Char.graveAccent=	192;
Mojo.Char.openBracket=	219;
Mojo.Char.backSlash=	220;
Mojo.Char.closeBracket=	221;
Mojo.Char.singleQuote=	222;

Mojo.Char.metaKey = 231; //NEED THIS FOR META CUT/ COPY/ PASTE


Mojo.Char.asciiZero = 48;
Mojo.Char.asciiNine = 57;

It also has several useful functions such as 'isEnterKey()' and 'isDeleteKey()'