|
I've answered this in private, but I think it is worth posting the solution here. In the definition of the VKeyboard object ("vkeyboard.js"), define the following method:
_force_lang_menu: function()
{
var vkb = this;
var ct = vkb.Cntr, menu = vkb.menu;
if(menu)
{ ct.removeChild(menu); vkb.menu = null; }
else
{
var fs = vkb.fontsize, kc = vkb.keycolor, bc = "1px solid " + vkb.bordercolor;
var mag = parseFloat(fs) / 14.0, cell = Math.floor(25.0 * mag), cp = cell + "px", lh = (cell - 2) + "px", w = String(102 * mag) + "px";
var h1 = Math.floor(cell + mag), h2 = String(100 * mag) + "px", pad = String(4 * mag) + "px";
var langs = vkb.avail_langs.length;
menu = document.createElement("DIV"); var ms = menu.style;
ms.display = "block";
ms.position = "relative";
ms.top = "1px", ms.left = "0px";
ms.width = w;
ms.border = bc;
ms.backgroundColor = vkb.bgcolor;
vkb.menu = ct.appendChild(menu);
var menu_main = document.createElement("DIV"); ms = menu_main.style;
ms.fontFamily = vkb.fontname;
ms.position = "relative";
ms.color = vkb.fontcolor;
ms.width = w;
ms.height = String(langs * h1 + 1) + "px";
ms.cursor = "default";
menu.appendChild(menu_main);
function setcolor(obj, c) { return function() { obj.style.backgroundColor = c; } };
for(var j = 0; j < langs; j++)
{
var item = vkb._setup_key(menu_main, "___lang_" + String(j), String(h1 * j + 1) + "px", "1px", h2, cp, "left", lh, fs, "normal", pad);
item.style.backgroundColor = kc;
item.style.border = bc;
item.innerHTML = vkb.avail_langs[j][1];
vkb._setup_event(item, 'mousedown', vkb._handle_lang_item);
vkb._setup_event(item, 'mouseover', setcolor(item, vkb.lic));
vkb._setup_event(item, 'mouseout', setcolor(item, kc));
}
}
},
By calling this method you can force the language selector menu open.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
It's an excellent project. Congrats.
Is there a way you could modify so that the 3-numpad-full can be used for adding or subtracting...
Thank you.
|
|
|
|
|
how to notify which key was actually pressed by the user?
like some depress image or colour effects to that particular button identifying key press.
thanx
|
|
|
|
|
There is a parameter in the VKeyboard constructor (18th in from the start) that toggles the on-press key flash animation; it is set to false by default. Search the article for:
true,
Hope it helps & best regards,
- Dmitry.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
I am using 3-edit-translator.html in which the parameter for the constructor is set to "true" as mentioned by you.
What i want is; if the user is using the keyboard (physical h/w) to keying the data i want the virtual keyboard to highlight (flash) the keys pressed on the h/w?
thanks.
|
|
|
|
|
I'll try to create such a script in a next few days.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Dvorak (UsD) and colemak (UsC) keyboard layouts
www.dvorak-keyboards.com
www.colemak.com
(i had problem with posting the code with '&#x' hence please replace $$ with the '&#x'
<pre>
<code>
UsD_normal: [ ["$$60;", "Grave"], "$$31;", "$$32;", "$$33;", "$$34;", "$$35;", "$$36;", "$$37;", "$$38;", "$$39;", "$$30;", "$$2D;", "$$3D;",
"$$2F;", "$$2C;", "$$2E;", "$$70;", "$$79;", "$$66;", "$$67;", "$$63;", "$$72;", "$$6C;", "$$5B;", "$$5D;", "$$5C;",
"$$61;", "$$6F;", "$$65;", "$$75;", "$$69;", "$$64;", "$$68;", "$$74;", "$$6E;", "$$73;", "$$27;", ,
"$$3B;", "$$71;", "$$6A;", "$$6B;", "$$78;", "$$62;", "$$6D;", "$$77;", "$$76;", "$$7A;",
],
UsD_caps: [ ["$$60;", "Grave"], "$$31;", "$$32;", "$$33;", "$$34;", "$$35;", "$$36;", "$$37;", "$$38;", "$$39;", "$$30;", "$$2D;", "$$3D;",
"$$2F;", "$$2C;", "$$2E;", "$$50;", "$$59;", "$$46;", "$$47;" "$$43;", "$$52;" "$$4C;", "$$5B;", "$$5D;", "$$5C;",
"$$41;", "$$4F;", "$$45;", "$$55;", "$$49;", "$$44;", "$$48;", "$$54;", "$$4E;", "$$53;", "$$27;", ,
"$$3B;", "$$51;", "$$4A;", "$$4B;", "$$58;", "$$42;", "$$4D;", "$$57;", "$$56;", "$$5A;",
],
UsD_shift: [ ["$$7E;", "Tilde"], "$$21;", "$$40;", "$$23;", "$$24;", "$$25;",
["$$5E;", "Circumflex"], "$$26;", "$$2A;", "$$28;", "$$29;", "$$5F;", "$$2B;",
"$$3F;", "$$3C;", "$$3E;", "$$50;", "$$59;", "$$46;", "$$47;", "$$43;", "$$52;", "$$4C;", "$$7B;", "$$7D;", "$$7C;",
"$$41;", "$$4F;", "$$45;", "$$55;", "$$49;", "$$44;", "$$48;", "$$54;", "$$4E;", "$$53;", "$$22;", ,
"$$3A;", "$$51;", "$$4A;", "$$4B;", "$$58;", "$$42;", "$$4D;", "$$57;", "$$56;", "$$5A;",
],
// colemak keyboard
UsC_normal: [ ["$$60;", "Grave"], "$$31;", "$$32;", "$$33;", "$$34;", "$$35;", "$$36;", "$$37;", "$$38;", "$$39;", "$$30;", "$$2D;", "$$3D;",
"$$71;", "$$77;", "$$66;", "$$70;", "$$67;", "$$6A;", "$$6C;", "$$75;", "$$79;", "$$3A;", "$$5B;", "$$5D;", "$$5C;",
"$$61;", "$$72;", "$$73;", "$$74;", "$$64;", "$$68;", "$$6E;", "$$65;", "$$69;", "$$6F;", "$$22;", ,
"$$7A;", "$$78;", "$$63;", "$$76;", "$$62;", "$$6B;", "$$6D;", "$$2C;", "$$2E;", "$$2F;"
],
UsC_caps: [ ["$$60;", "Grave"], "$$31;", "$$32;", "$$33;", "$$34;", "$$35;", "$$36;", "$$37;", "$$38;", "$$39;", "$$30;", "$$2D;", "$$3D;",
"$$51;", "$$57;", "$$46;", "$$50;", "$$47;", "$$4A;", "$$4C;", "$$55;", "$$59;", "$$3B;", "$$5B;", "$$5D;", "$$5C;",
"$$41;", "$$52;", "$$53;", "$$54;", "$$44;", "$$48;", "$$4E;", "$$45;", "$$49;", "$$4F;", "$$27;", ,
"$$5A;", "$$58;", "$$43;", "$$56;", "$$42;", "$$4B;", "$$4D;", "$$2C;", "$$2E;", "$$2F;"
],
UsC_shift: [ ["$$7E;", "Tilde"], "$$21;", "$$40;", "$$23;", "$$24;", "$$25;",
["$$5E;", "Circumflex"], "$$26;", "$$2A;", "$$28;", "$$29;", "$$5F;", "$$2B;",
"$$51;", "$$57;", "$$46;", "$$50;", "$$47;", "$$4A;", "$$4C;", "$$55;", "$$59;", "$$3B;", "$$7B;", "$$7D;", "$$7C;",
"$$41;", "$$52;", "$$53;", "$$54;", "$$44;", "$$48;", "$$4E;", "$$45;", "$$49;", "$$4F;", "$$27;", ,
"$$5A;", "$$58;", "$$43;", "$$56;", "$$42;", "$$4B;", "$$4D;", "$$3C;", "$$3E;", "$$3F;"
],</code></pre>
|
|
|
|
|
I have noticed users at my kiosk implementation of the virtual keyboard pausing in search of the "spacebar". Although most users will know where the spacebar is, how can I include the text "Spacebar" on the keyboard? I tried altering vkboard.js by adding kb_space.innerHTML = "Spacebar"; but this did not add the text over the spacebar. Suggestions?
Thanks,
Jerry
|
|
|
|
|
Hi Jerry,
McJerry wrote: how can I include the text "Spacebar" on the keyboard?
1. In the _refresh_layout method, search for the line:
key.innerHTML = this.DeadAction[1] ? this.DeadAction[0] : " "; Change it to:
key.innerHTML = this.DeadAction[1] ? this.DeadAction[0] : "Space";
2. In the _generic_callback_proc method, search for the line:
case " ": val = " "; break; Change it to:
case "Space": val = " "; break; Hope it helps Best regards,
- Dmitry.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Thanks Dmitry! That worked perfectly.
I was using a different javascript virtual keyboard implementation but users were struggling due to multiple issues. I have noticed an instantaneous improvement in user response since deploying your script. Before, users would simply become frustrated and walk away from the kiosk...now they find it much easier to complete the web form. I contribute this to the ease of use offered after customizing your keyboard layout.
Have a great Week!
-Jerry
|
|
|
|
|
This works well.
Is there any way to make the "Space" label appear non-bold like the other "special" keys (Enter, Tab, Shift, etc.)? Yes, in reality "Space" is a character like 'A', '?', etc., but it seems more like a "special" key.
Also (and speaking of...), is there a way to set a different color for the special keys?
Thanks,
Jelks
|
|
|
|
|
Today, on the 10th of April, Virtual Keyboard celebrates it's 2nd year of existence. Thank you everyone who supported it with ideas, bugfixes, money
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
modified on Thursday, April 10, 2008 12:47 PM
|
|
|
|
|
When I jump (with Tab) to a new field, the caret is not visible.
So I dont know "where I am" before I start typing
And the caret also disappears in any field when I'm start typing. It's the fact for both test-fly and test-fly-anonym.
/Benny
|
|
|
|
|
Perhaps there is an explanation.
But after I've changed the _set_key_state to "mouseup" event the caret is visible !
Thanks again.
/Benny
|
|
|
|
|
Another issue:
When you type fast on different keys it works fine.
But if you type faste twice on the same key, only one letter is transformed to the input field.
If you type 4 equal letters 2 of them are displayed.
If you type 6 equal letters 3 of them are displayed.
etc. etc.
Where do I have to look to find the place where this "delay" is defined ?
The problem exist both with key flash on and off.
/Benny
modified on Friday, February 8, 2008 7:30 AM
|
|
|
|
|
Hi,
Benny Nielsen wrote: Where do I have to look to find the place where this "delay" is defined ?
It is not "defined". What you should do is to change the "mousedown" event in the _set_key_state method to "mouseup". This will solve this typing issue.
Best regards,
- Dmitry.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
You are the greatest !!!
|
|
|
|
|
Great job !
I have tried the test-fly-anonym and it works perfect.
Almost ...
I have only single lines text (no textareas) and I would like to "jump" to the next field on my form when the user press TAB or Enter.
Any possibilities ?
Regards
Benny
|
|
|
|
|
Hi!
Member 4531434 wrote: I have only single lines text (no textareas) and I would like to "jump" to the next field on my form when the user press TAB or Enter.
in the '6-test-fly-anonym.html' file, search for the keyb_callback method. In the switch block inside it, you should add cases for \t (tab key) and \n (enter key). Then you can write these cases to focus() to a next field.
Hope it helps,
- Dmitry.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Thank you very much !
It works for \t but not for \n ?
Can you explain this ?
/Benny
modified on Tuesday, February 05, 2008 8:44:12 AM
|
|
|
|
|
I solved it myself.
It's not the switch \n but the switch Enter you may use
|
|
|
|
|
I am not entirely knowledgeable with making the changes necessary to make the tab key jump to the next field. Would you share the code changes you made to get this to work?
Thanks,
-Jerry
|
|
|
|
|
In the keyb_callback function I added the cases:
case "\t":
doNext(source);
getCaretPositions(source);
break;
case "Enter":
doNext(source);
getCaretPositions(source);
break;
Where doNext is:
function doNext(el)
{
var f = el.form;
var els = f.elements;
var x, hit, nextEl;
for (var i=0, len=els.length; i<(len-1); i++){
x = els[i];
if (el == x && (nextEl = els[i+1])){
if (nextEl.focus) nextEl.focus();
hit = i;
}
}
el = els[hit+1];
}
I hope this will help you.
Regards
Benny
|
|
|
|
|
Sorry but I came to a new question:
When I jump to a new field, the cursor mark is not visible.
So I dont know "where I am" before I start typing
And the cursor mark also disappears in any field when I'm starting typing. It's the fact for both test-fly and test-fly-anonym.
/Benny
modified on Tuesday, February 05, 2008 8:44:39 AM
|
|
|
|
|
Hi there~
1st of all, thank you(creator) for this keyboard, it has helped me alot~
Anyways i've been wondering how to show and hide the keyboard for this example(5-test-fly.html), i tried following the 2-edit-full.html example and edit it from there but still can't get it to work, the keyboard wouldn't enter anything into the textfields, i think it has something to do with the focus.
Hope someone can help out here~ Thanks!
|
|
|
|
|