Forums


Comfort Software :: Forums :: Development
<< Previous thread | Next thread >>   

How to manipulate the on-screen keyboard from HTML

Author Post
Comfort
Wed May 14 2008, 12:55pm


Joined: Wed Sep 19 2007, 03:42pm
Posts: 545
If you are writing kiosk software using HTML, you can control the on-screen keyboard with special JavaScript functions.

You can show, hide and move the keyboard using JavaScript. The process is simple: special JavaScript functions add keyboard-related information to the browser caption and the program monitors it for changes.

Download the file with JavaScript functions and examples located at http://www.comfort-software.com/commander.html

These functions work in all well-known browsers: Internet Explorer, Firefox, Google Chrome, Opera, Safari...

[ Edited Thu Apr 28 2011, 01:33pm ]

Have a nice day
Back to top
Barbetto80
Tue May 27 2008, 09:40am
Registered Member #116
Joined: Tue May 27 2008, 09:24am
Posts: 5
Hi, i have seen your implementation for html page to load/unload the software.

It would be good if the open/close of the virtual keyboard could be called via javascript using the same classid....so that when you have a web page,

1) when you click on a text you should make it appear (onfocus)
2) and when you click somewhere else it disappear (onblur)

by now i only make a workaround by rewriting the pbject all tha time but this is just a workaround..

maybe you can implement 2 simple call in your activex to /show /notshow the program?

Back to top
Barbetto80
Tue May 27 2008, 10:30am
Registered Member #116
Joined: Tue May 27 2008, 09:24am
Posts: 5
ps my workaround if useful:

<span id='int_tsc' style='position:absolute;top:-100px;left-100px;'></span>
<script>
var tsc_sh=\"<OBJECT ID='CsShowKeyboardFormX1' WIDTH=0 HEIGHT=0 \";
tsc_sh+=\"CLASSID='CLSID:90B8E669-2EE4-47BC-B7C9-C0CB5C80A86E' \";
tsc_sh+=\"CODEBASE='http://www.comfort-software.com/keyboard/cskeyboard.ocx'> \";
tsc_sh+=\"<PARAM NAME='Visible' VALUE='0'> \";
tsc_sh+=\"<PARAM NAME='AutoScroll' VALUE='0'> \";
tsc_sh+=\"<PARAM NAME='AutoSize' VALUE='0'> \";
tsc_sh+=\"<PARAM NAME='AxBorderStyle' VALUE='1'> \";
tsc_sh+=\"<PARAM NAME='Caption' VALUE='Comfort On-Screen Keyboard Panel'> \";
tsc_sh+=\"<PARAM NAME='Color' VALUE='4278190095'> \";
tsc_sh+=\"<PARAM NAME='Font' VALUE='Tahoma'> \";
tsc_sh+=\"<PARAM NAME='KeyPreview' VALUE='0'> \";
tsc_sh+=\"<PARAM NAME='PixelsPerInch' VALUE='96'> \";
tsc_sh+=\"<PARAM NAME='PrintScale' VALUE='1'> \";
tsc_sh+=\"<PARAM NAME='Scaled' VALUE='-1'> \";
tsc_sh+=\"<PARAM NAME='DropTarget' VALUE='0'> \";
tsc_sh+=\"<PARAM NAME='HelpFile' VALUE=''> \";
tsc_sh+=\"<PARAM NAME='PopupMode' VALUE='0'> \";
tsc_sh+=\"<PARAM NAME='ScreenSnap' VALUE='0'> \";
tsc_sh+=\"<PARAM NAME='SnapBuffer' VALUE='10'> \";
tsc_sh+=\"<PARAM NAME='DockSite' VALUE='0'> \";
tsc_sh+=\"<PARAM NAME='DoubleBuffered' VALUE='0'> \";
tsc_sh+=\"<PARAM NAME='UseDockManager' VALUE='0'> \";
tsc_sh+=\"<PARAM NAME='Enabled' VALUE='0'> \";
tsc_sh+=\"<PARAM NAME='AlignWithMargins' VALUE='0'> \";
tsc_sh+=\"</OBJECT>\";

var tsc_hi=\"<OBJECT ID='CsShowKeyboardFormX1' WIDTH=0 HEIGHT=0 \";
tsc_hi+=\"CLASSID='CLSID:9D571E34-3146-471F-B148-2AC0989BC7A4' \";
tsc_hi+=\"CODEBASE='http://www.comfort-software.com/keyboard/cskeyboard.ocx'> \";
tsc_hi+=\"<PARAM NAME='Visible' VALUE='0'> \";
tsc_hi+=\"<PARAM NAME='AutoScroll' VALUE='0'> \";
tsc_hi+=\"<PARAM NAME='AutoSize' VALUE='0'> \";
tsc_hi+=\"<PARAM NAME='AxBorderStyle' VALUE='1'> \";
tsc_hi+=\"<PARAM NAME='Caption' VALUE='Comfort On-Screen Keyboard Panel'> \";
tsc_hi+=\"<PARAM NAME='Color' VALUE='4278190095'> \";
tsc_hi+=\"<PARAM NAME='Font' VALUE='Tahoma'> \";
tsc_hi+=\"<PARAM NAME='KeyPreview' VALUE='0'> \";
tsc_hi+=\"<PARAM NAME='PixelsPerInch' VALUE='96'> \";
tsc_hi+=\"<PARAM NAME='PrintScale' VALUE='1'> \";
tsc_hi+=\"<PARAM NAME='Scaled' VALUE='-1'> \";
tsc_hi+=\"<PARAM NAME='DropTarget' VALUE='0'> \";
tsc_hi+=\"<PARAM NAME='HelpFile' VALUE=''> \";
tsc_hi+=\"<PARAM NAME='PopupMode' VALUE='0'> \";
tsc_hi+=\"<PARAM NAME='ScreenSnap' VALUE='0'> \";
tsc_hi+=\"<PARAM NAME='SnapBuffer' VALUE='10'> \";
tsc_hi+=\"<PARAM NAME='DockSite' VALUE='0'> \";
tsc_hi+=\"<PARAM NAME='DoubleBuffered' VALUE='0'> \";
tsc_hi+=\"<PARAM NAME='UseDockManager' VALUE='0'> \";
tsc_hi+=\"<PARAM NAME='Enabled' VALUE='0'> \";
tsc_hi+=\"<PARAM NAME='AlignWithMargins' VALUE='0'> \";
tsc_hi+=\"</OBJECT>\";

function show_tsc() {
document.getElementById('int_tsc').innerHTML=tsc_sh;
}
function hide_tsc() {
document.getElementById('int_tsc').innerHTML=tsc_hi;
}
</script>

[ Edited Mon Dec 14 2009, 09:22am ]
Back to top
Comfort
Tue May 27 2008, 02:17pm


Joined: Wed Sep 19 2007, 03:42pm
Posts: 545
I cannot give an answer at once.
Maybe it will be useful to check a new option "Show the floating On-Screen Keyboard icon next to the text cursor when possible"?

Have a nice day
Back to top
TheLandYacht
Tue Feb 03 2009, 03:57pm
Registered Member #249
Joined: Tue Feb 03 2009, 03:55pm
Posts: 2
Tried your example. It works like a champ in Internet Explorer, but Firefox does nothing. Can you confirm?
Back to top
Comfort
Wed Feb 04 2009, 12:32am


Joined: Wed Sep 19 2007, 03:42pm
Posts: 545
What code don't work: http://www.comfort-software.com/download/keyboardx.zip or from Barbetto80?

Have a nice day
Back to top
TheLandYacht
Sat Feb 07 2009, 06:18pm
Registered Member #249
Joined: Tue Feb 03 2009, 03:55pm
Posts: 2
Comfort wrote ...

What code don't work: http://www.comfort-software.com/download/keyboardx.zip or from Barbetto80?


Sorry, didn't realize there was a difference, didn't even look at the example pasted in.

Starting from your link in the first post. IE works fine, FF (most recent version) does not.
Back to top
Comfort
Thu Feb 12 2009, 01:07am


Joined: Wed Sep 19 2007, 03:42pm
Posts: 545
OCX and ActiveX elements work only with IE, and nothing else.
http://support.mozilla.com/kb/Activex

Have a nice day
Back to top
Moderators: Comfort

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System