Click here to Skip to main content
15,891,033 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: "ASP" Email sending problem.. Pin
D.Manivelan22-Mar-09 18:43
D.Manivelan22-Mar-09 18:43 
GeneralRe: "ASP" Email sending problem.. Pin
tech60324-Mar-09 3:32
tech60324-Mar-09 3:32 
QuestionAjax enabled page stops responding after kept idle for some time Pin
Member 56545116-Mar-09 2:08
Member 56545116-Mar-09 2:08 
Questionsending emails on localhost Pin
NetQuestions15-Mar-09 22:29
NetQuestions15-Mar-09 22:29 
AnswerRe: sending emails on localhost Pin
Marc Firth15-Mar-09 23:24
Marc Firth15-Mar-09 23:24 
GeneralRe: sending emails on localhost Pin
tech60316-Mar-09 17:51
tech60316-Mar-09 17:51 
GeneralRe: sending emails on localhost Pin
NetQuestions19-Mar-09 3:11
NetQuestions19-Mar-09 3:11 
QuestionPhysical key/keyboard layout detection in JS Pin
eesheesh15-Mar-09 11:15
eesheesh15-Mar-09 11:15 
Hi,

I need to find a way to detect which PHYSICAL key is pressed, using Javascript. The best that JS can offer, as far as I can see, is finding the Virtual Key code of a key (With onkeyup/onkeydown), which doesn't always map to the same physical key (For example, the key under 6 and 7 on the US keyboard is Y and sends DOM_VK_Y virtual key code, but in the German layout it's Z and it sends DOM_VK_Z). Those VKs would be enough info if I knew which keyboard layout the user is using.

Some background on keyboard layouts, because this is a confusing subject: A keyboard sends a scan code, which is more or less standardized across all "normal" keyboards, so that key under 6 and 7 (The US layout Y and German Z) always sends the same code. The OS (Let's say Windows) translates that into a Virtual Key code, that in case of the latin letters is usually the same as the ASCII code for the letter on the key, but really doesn't have to be the same, and with non-latin-script languages, it isn't. You can look up VK_* constants in Win32 API. That translation is dependent upon the current layout. From there, the VKs are translated to characters, again, according to the keyboard layout.

If I get the VKs (easy part) plus know the current layout (what I'm asking), then I can check the tables and see what physical key was pressed. I'm also open to other methods I may not have thought about.


What I have already tried:
1. Flash - Tried using ActionScript functions to get the browser's current keyboard layout. Can't be done. Tried using Flash's keyboard events to get the scan codes (Windows' WM_CHAR and the likes have that info in them), but Flash doesn't supply that info. I might have missed something there, because I couldn't find good documentation on the subject.
2. Java Applets - Since the Java plugin gets loaded once per browser session, I can only get the layout the browser process had when when a Java applet was first called, and who knows when that was. Changing the layout in the browser doesn't affect the layout in the Java plugin, so there's no way to tell what happened since Java was first loaded. I used java.awt.im.InputContext.getInstance().getLocale(). Using a Java textbox instead of an HTML element is out of the question for various reasons.
3. JS dispatchEvent/fireEvent - Tried to see if I can emulate the pressing of certain VKs and see what Unicode chars they generate, and try to guess the layout from that. Unfortunately, Javascript can't really emulate keystrokes, just single events, so onkeydown (That has VK info) didn't cause onkeypress (That has char code info) to be generated, so that can't be used.

At that point my ideas ran dry. I hope that listing them here would at least help someone else think of something...

Thank you!
Questionexecuting php code from mysql Pin
Ahmad Hamid15-Mar-09 6:27
Ahmad Hamid15-Mar-09 6:27 
AnswerRe: executing php code from mysql Pin
Mohammad Dayyan15-Mar-09 22:13
Mohammad Dayyan15-Mar-09 22:13 
AnswerRe: executing php code from mysql Pin
Marc Firth15-Mar-09 23:43
Marc Firth15-Mar-09 23:43 
GeneralRe: executing php code from mysql Pin
Ahmad Hamid16-Mar-09 0:08
Ahmad Hamid16-Mar-09 0:08 
GeneralRe: executing php code from mysql Pin
Marc Firth16-Mar-09 1:39
Marc Firth16-Mar-09 1:39 
QuestionI AM JUST GETTING STARTED Pin
patrice pilgrim15-Mar-09 2:29
patrice pilgrim15-Mar-09 2:29 
AnswerRe: I AM JUST GETTING STARTED Pin
scottgp15-Mar-09 10:24
professionalscottgp15-Mar-09 10:24 
GeneralRe: I AM JUST GETTING STARTED Pin
tech60318-Mar-09 15:58
tech60318-Mar-09 15:58 
AnswerRe: I AM JUST GETTING STARTED Pin
Marc Firth15-Mar-09 23:28
Marc Firth15-Mar-09 23:28 
Questioncreate a nested table with javascript Pin
emilio_ts14-Mar-09 5:17
emilio_ts14-Mar-09 5:17 
AnswerRe: create a nested table with javascript Pin
tech60318-Mar-09 16:10
tech60318-Mar-09 16:10 
GeneralRe: create a nested table with javascript Pin
emilio_ts19-Mar-09 0:52
emilio_ts19-Mar-09 0:52 
AnswerRe: create a nested table with javascript Pin
Naruki23-Mar-09 20:20
Naruki23-Mar-09 20:20 
QuestionType Incompatible When Calling ActiveXObejct's Method in Web Page Pin
Xiaoming Qian12-Mar-09 17:20
Xiaoming Qian12-Mar-09 17:20 
QuestionObject cannot be extended in IE - Object does not support this property or method Pin
Jayapal Chandran11-Mar-09 22:22
Jayapal Chandran11-Mar-09 22:22 
QuestionAdd/Edit in ModalPopupExtender Pin
VikashGohil11-Mar-09 20:56
VikashGohil11-Mar-09 20:56 
AnswerRe: Add/Edit in ModalPopupExtender Pin
StianSandberg12-Mar-09 2:50
StianSandberg12-Mar-09 2:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.