English 中文(简体)
查阅 Java文中现有主要布局语言
原标题:Get the current keyboard layout language in JavaScript

我正在使用轮椅。 当我目前的主机布局不是英语时,我会把一些案文输入母国局的网站。 SendKeys是没有预见的。

我想我的职责是检查语言是英语,否则就会把ALT+SHIFT改为英语。 对我来说,很难找到一种能够恢复目前主要布局的职能。

If anyone is familiar with a way doing it, I will be glad to know..

Thanks, Rotem

最佳回答

奥基先生,我以“影子”为帮助。

如果任何人想要知道(=)的话,这是法典。

感谢!

    var lastKeyPressed = 0;

function sendKey()
{
    var WshShell = new ActiveXObject("WScript.Shell");
    WshShell.SendKeys(  a  );
}

function getCurLayout()
{
    sendKey();
    setTimeout("lastKeyLang()",10);
}

function lastKeyLang()
{
    if( lastKeyPressed == 97 )
        alert(  EN  );
    else
        alert(  HE  );  
}

document.onkeypress = saveLastKey;  
function saveLastKey()
{
    lastKeyPressed = window.event.keyCode;
}
问题回答

文本框中的“A”改为:

nValue = oTextbox.value.charCodeAt(0);

如果<代码>nValue是65种布局外的英文,则可能发送<代码>>。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签