В VB раскладку клавиатуры меняю так:
В модуле
Public Const vKF1 = &H70
Public Const KEYEVENTF_KEYDOWN = &H0
Public Const KEYEVENTF_KEYUP = &H2
Public Const HKL_NEXT As Long = 1
Public Const HKL_PREV As Long = 0
Public Enum enmKeybordLayout ' Раскладки клавиатуры
kbrdEnglish = 67699721
kbrdRussian = 68748313
End Enum
' Пример: keybd_event vKF1, 0, KEYEVENTF_KEYUP, 0
Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Integer, ByVal bScan As Integer, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer)
Public Declare Function GetKeyboardLayout Lib "user32" (ByVal dwLayout As Long) As Long
Public Declare Function ActivateKeyboardLayout Lib "user32" (ByVal HKL As Long, ByVal flags As Long) As Long
' Пример: SetLayout kbrdEnglish
Public Sub SetLayout(ByVal myLayout As enmKeybordLayout) ' Включить выбранную раскладку клавы
On Error Resume Next
Dim lngReturn As Long
Dim lngCodeKeybord As Long
lngReturn = GetKeyboardLayout(lngCodeKeybord) 'Получить текущую раскладку
If lngReturn <> CLng(myLayout) Then 'Если раскладки не совпадают, значит, надо переключиться
Call ActivateKeyboardLayout(HKL_NEXT, 0)
End If
End Sub
в свойствах полей:
Private Sub Ing_GotFocus()
SetLayout kbrdEnglish
End Sub
Private Sub Rus_GotFocus()
SetLayout kbrdRussian
End Sub
На WEB странице делаю так (маппинг раскладки) :
<input id="en" type="text"/>
<script>
var type = {
1081: "q", 1094: "w", 1091: "e", 1082: "r", 1077: "t", 1085: "y",
1075: "u", 1096: "i", 1097: "o", 1079: "p", 1093: "[", 1098: "]",
1092: "a", 1099: "s", 1074: "d", 1072: "f", 1087: "g", 1088: "h",
1083: "k", 1076: "l", 1078: ";", 1101: "'", 1103: "z", 1095: "x",
1089: "c", 1084: "v", 1080: "b", 1090: "n", 1100: "m", 1073: ",",
1102: ".", 1049: "Q", 1062: "W", 1059: "E", 1050: "R", 1045: "T",
1053: "Y", 1043: "U", 1064: "I", 1065: "O", 1047: "P", 1061: "{",
1066: "}", 1060: "A", 1067: "S", 1042: "D", 1040: "F", 1055: "G",
1056: "H", 1054: "J", 1051: "K", 1044: "L", 1046: ":", 1069: "\"",
1071: "Z", 1063: "X", 1057: "C", 1052: "V", 1048: "B", 1058: "N",
1068: "M", 1041: "<", 1070: ">", 1105: "`", 1025: "~", 8470: "#",
1086: "j"
};
document.getElementById("en").onkeypress = function (e) {
console.log(e.which);
if (e.which > 126) {
this.value += type[e.which];
return false;
}
}
</script>
Как этот маппинг сделать в Acrobat, если можно пример.
Всем спасибо.
В модуле
Public Const vKF1 = &H70
Public Const KEYEVENTF_KEYDOWN = &H0
Public Const KEYEVENTF_KEYUP = &H2
Public Const HKL_NEXT As Long = 1
Public Const HKL_PREV As Long = 0
Public Enum enmKeybordLayout ' Раскладки клавиатуры
kbrdEnglish = 67699721
kbrdRussian = 68748313
End Enum
' Пример: keybd_event vKF1, 0, KEYEVENTF_KEYUP, 0
Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Integer, ByVal bScan As Integer, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer)
Public Declare Function GetKeyboardLayout Lib "user32" (ByVal dwLayout As Long) As Long
Public Declare Function ActivateKeyboardLayout Lib "user32" (ByVal HKL As Long, ByVal flags As Long) As Long
' Пример: SetLayout kbrdEnglish
Public Sub SetLayout(ByVal myLayout As enmKeybordLayout) ' Включить выбранную раскладку клавы
On Error Resume Next
Dim lngReturn As Long
Dim lngCodeKeybord As Long
lngReturn = GetKeyboardLayout(lngCodeKeybord) 'Получить текущую раскладку
If lngReturn <> CLng(myLayout) Then 'Если раскладки не совпадают, значит, надо переключиться
Call ActivateKeyboardLayout(HKL_NEXT, 0)
End If
End Sub
в свойствах полей:
Private Sub Ing_GotFocus()
SetLayout kbrdEnglish
End Sub
Private Sub Rus_GotFocus()
SetLayout kbrdRussian
End Sub
На WEB странице делаю так (маппинг раскладки) :
<input id="en" type="text"/>
<script>
var type = {
1081: "q", 1094: "w", 1091: "e", 1082: "r", 1077: "t", 1085: "y",
1075: "u", 1096: "i", 1097: "o", 1079: "p", 1093: "[", 1098: "]",
1092: "a", 1099: "s", 1074: "d", 1072: "f", 1087: "g", 1088: "h",
1083: "k", 1076: "l", 1078: ";", 1101: "'", 1103: "z", 1095: "x",
1089: "c", 1084: "v", 1080: "b", 1090: "n", 1100: "m", 1073: ",",
1102: ".", 1049: "Q", 1062: "W", 1059: "E", 1050: "R", 1045: "T",
1053: "Y", 1043: "U", 1064: "I", 1065: "O", 1047: "P", 1061: "{",
1066: "}", 1060: "A", 1067: "S", 1042: "D", 1040: "F", 1055: "G",
1056: "H", 1054: "J", 1051: "K", 1044: "L", 1046: ":", 1069: "\"",
1071: "Z", 1063: "X", 1057: "C", 1052: "V", 1048: "B", 1058: "N",
1068: "M", 1041: "<", 1070: ">", 1105: "`", 1025: "~", 8470: "#",
1086: "j"
};
document.getElementById("en").onkeypress = function (e) {
console.log(e.which);
if (e.which > 126) {
this.value += type[e.which];
return false;
}
}
</script>
Как этот маппинг сделать в Acrobat, если можно пример.
Всем спасибо.