Online keyboard, web application - Help needed

Discussion in 'Programming' started by webdesigner, Nov 7, 2006.

  1. #1
    Hi...

    I see a need for some sort of web application that i can have on my website which would show a keyboard and would allow key presses to correspond with specified unicode. I've been searching for hours on google to try and discover a starting point but getting nowhere...

    Could someone please tell me what code i would have to learn to create this and links to any resources if possible.

    Thanks in advance
     
    webdesigner, Nov 7, 2006 IP
  2. PinotNoir

    PinotNoir Peon

    Messages:
    505
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You may want to consider using Flash as the interface for this.
    http://livedocs.macromedia.com/flas....htm?context=Flash_MX_2004&file=00001377.html

    If you are not familiar with Flash, this will be a daunting task.

    I recommend requesting a Flash expert on this forum or SitePoint, actionscript.org, or other forums.

    If you can ever get this link to load, it looks promising too.
    http://www.tutorialselect.com/frame...tionscripting/actionSc-Daniel_S-862/index.php
    This was what you wanted, but appears to be broken somewhat.

    Flash's actionscript will let you use addListener and key.getCode to help you with this. I can't find a good link for it on Google. You can try other engines. You are going to run into a lot of musical keyboards and typewriter text effect tutorials, but you should find what you want if you keep searching diligently.
     
    PinotNoir, Nov 7, 2006 IP
  3. KC TAN

    KC TAN Well-Known Member

    Messages:
    4,792
    Likes Received:
    353
    Best Answers:
    0
    Trophy Points:
    155
    #3
    Is using AJAX ok with you? I have recently sold a site that has the hotkey enabled function powered by AJAX.

    Basically you need to call a function to check the unicode upon body load:
    
    <body onkeydown="getnum(event)">
    
    Code (markup):
    Your getnum will look like:
    
    var keynum;
    
    function getnum(e){  
    	if(window.event) // IE
    	{
    	keynum = e.keyCode
    	}
    	else if(e.which) // Netscape/Firefox/Opera
    	{
    	keynum = e.which}
    }
    
    Code (markup):
    I think you get the idea now ;)

    Keynum will include the unicode of the key pressed. From here, simply create the respective functions to execute upon matching of keynum.
     
    KC TAN, Nov 7, 2006 IP