Permalink
Browse files

added Thai layout

  • Loading branch information...
1 parent 4b7041c commit a91a62d6d3fd7c995f70c9c604e9e2b5f68f47d1 @Mottie committed Dec 13, 2012
Showing with 76 additions and 0 deletions.
  1. +1 −0 layouts.html
  2. +75 −0 layouts/thai.js
View
@@ -168,6 +168,7 @@ <h4>This is a work in progress.</h4>
<option value="spanish" class="spanish-qwerty-sp">Spanish (qwerty) special</option>
<option value="swedish" class="swedish-qwerty">Swedish (qwerty)</option>
<option value="swedish" class="swedish-dvorak">Swedish (dvorak)</option>
+ <option value="thai" class="thai-qwerty">Thai (qwerty)</option>
<option value="turkish" class="turkish-q">Turkish (q)</option>
<option value="turkish" class="turkish-f">Turkish (f)</option>
View
@@ -0,0 +1,75 @@
+/* Thai keyboard layouts
+ * contains layout: 'thai-qwerty'
+ *
+ * To use:
+ * Point to this js file into your page header: <script src="layouts/thai.js" type="text/javascript"></script>
+ * Initialize the keyboard using: $('input').keyboard({ layout: 'thai-qwerty' });
+ *
+ * license for this file: WTFPL, unless the source layout site has a problem with me using them as a reference
+ */
+
+/* based on http://ascii-table.com/keyboard.php/190 */
+$.keyboard.layouts['thai-qwerty'] = {
+ 'default' : [
+ "\u005F \u0E45 \u002F \u002D \u0E20 \u0E16 \u0E38 \u0E36 \u0E04 \u0E05 \u0E08 \u0E02 \u0E0A {bksp}",
+ "{tab} \u0E46 \u0E44 \u0E33 \u0E1E \u0E30 \u0E31 \u0E35 \u0E23 \u0E19 \u0E22 \u0E1A \u0E25 \u0E03 ",
+ "\u0E1F \u0E2B \u0E01 \u0E14 \u0E40 \u0E49 \u0E48 \u0E32 \u0E2A \u0E27 \u0E07 {enter}",
+ "{shift} \u0E1C \u0E1B \u0E41 \u0E2D \u0E34 \u0E37 \u0E17 \u0E21 \u0E43 \u0E1D {shift}",
+ "{accept} {alt} {space} {alt} {cancel}"
+ ],
+ 'shift' : [
+ "% + \u0E51 \u0E52 \u0E53 \u0E54 \u0E39 \u0E3F \u0E55 \u0E56 \u0E57 \u0E58 \u0E59 {bksp}",
+ "{tab} \u0E50 \u0022 \u0E0E \u0E11 \u0E18 \u0E4D \u0E4A \u0E13 \u0E2F \u0E0D \u0E10 \u002C \u0E05",
+ "\u0E24 \u0E06 \u0E0F \u0E42 \u0E0C \u0E47 \u0E4B \u0E29 \u0E28 \u0E0B \u002E {enter}",
+ "{shift} ( ) \u0E09 \u0E2E \u0E3A \u0E4C \u003F \u0E12 \u0E2C \u0E26 {shift}",
+ "{accept} {alt} {space} {alt} {cancel}"
+ ],
+ 'alt' : [
+ "\u0060 1 2 3 4 5 6 7 8 9 0 - \u003D {bksp}",
+ "{tab} q w e r t y u i o p \u005B \u005D \u005C",
+ "a s d f g h j k l ; \u0027 {enter}",
+ "{shift} z x c v b n m , . / {shift}",
+ "{accept} {alt} {space} {alt} {cancel}"
+ ],
+ 'alt-shift' : [
+ "\u007E | @ # $ % \u00ac & * ( ) _ + {bksp}",
+ "{tab} Q W E R T Y U I O P ! \u00a6 \u00a2",
+ "A S D F G H J K L : \" {enter}",
+ "{shift} Z X C V B N M { } ? {shift}",
+ "{accept} {alt} {space} {alt} {cancel}"
+ ]
+};
+
+// Keyboard Language
+// please update this section to match this language and email me with corrections!
+// ***********************
+if (typeof(language) === 'undefined') { var language = {}; };
+language.thai = {
+ display : {
+ 'a' : '\u2714:Validate (Shift-Enter)', // check mark - same action as accept
+ 'accept' : 'accept (Shift-Enter)',
+ 'alt' : 'Alt:More Characters',
+ 'b' : '\u2190:Backspace', // Left arrow (same as &larr;)
+ 'bksp' : 'Bksp:Backspace',
+ 'c' : '\u2716:Escape (Esc)', // big X, close - same action as cancel
+ 'cancel' : 'Cancel (Esc)',
+ 'clear' : 'C:Clear', // clear num pad
+ 'combo' : '\u00f6:Toggle Combo Keys',
+ 'dec' : '.:Decimal point', // decimal point for num pad (optional), change '.' to ',' for European format
+ 'e' : '\u21b5:Enter', // down, then left arrow - enter symbol
+ 'enter' : 'Enter:Enter',
+ 'lock' : '\u21ea Lock:Caps Lock', // caps lock
+ 's' : '\u21e7:Shift', // thick hollow up arrow
+ 'shift' : 'Shift:Shift',
+ 'sign' : '\u00b1:Sign for num pad', // +/- sign for num pad
+ 'space' : 'Space',
+ 't' : '\u21e5:Tab', // right arrow to bar (used since this virtual keyboard works with one directional tabs)
+ 'tab' : '\u21e5 Tab:Tab' // \u21b9 is the true tab symbol (left & right arrows)
+ },
+ // Message added to the key title while hovering, if the mousewheel plugin exists
+ wheelMessage : 'You can use the mouse wheel to see additional keys',
+};
+
+// This will replace all default language options with these language options.
+// it is separated out here so the layout demo will work properly.
+$.extend(true, $.keyboard.defaultOptions, language.thai);

0 comments on commit a91a62d

Please sign in to comment.