From 91c16cd9ddc29b722419a5a3479cfe300fa5bfdb Mon Sep 17 00:00:00 2001 From: Toyoyo Toyo Date: Fri, 1 Apr 2022 18:31:49 +0200 Subject: [PATCH] Initial release --- COPYING.TXT | 4 + DATE.INC | 60 ++ GETKBD.ASM | 497 +++++++++++++++ KBDQWFR.ASM | 1729 ++++++++++++++++++++++++++++++++++++++++++++++++++ KBDQWFR.DEF | 20 + KBDQWFR.DLL | Bin 0 -> 2184 bytes KEYBOARD.INC | 237 +++++++ MAKEFILE | 58 ++ NAMES.ASM | 91 +++ NAMESUS.INC | 147 +++++ README.MD | 74 +++ README.TXT | 59 ++ TRANS.INC | 67 ++ VKOEM.INC | 89 +++ VKWIN.INC | 131 ++++ 15 files changed, 3263 insertions(+) create mode 100644 COPYING.TXT create mode 100644 DATE.INC create mode 100644 GETKBD.ASM create mode 100644 KBDQWFR.ASM create mode 100644 KBDQWFR.DEF create mode 100644 KBDQWFR.DLL create mode 100644 KEYBOARD.INC create mode 100644 MAKEFILE create mode 100644 NAMES.ASM create mode 100644 NAMESUS.INC create mode 100644 README.MD create mode 100644 README.TXT create mode 100644 TRANS.INC create mode 100644 VKOEM.INC create mode 100644 VKWIN.INC diff --git a/COPYING.TXT b/COPYING.TXT new file mode 100644 index 0000000..fd4df5e --- /dev/null +++ b/COPYING.TXT @@ -0,0 +1,4 @@ +Original files are from Win3.1 DDK, (c) Microsoft Corporation. +Qwerty-fr is covered by GNU/GPL 2.0. + +Changes from KBDUS.ASM to KBDQWFR.ASM are to be considered public domain. diff --git a/DATE.INC b/DATE.INC new file mode 100644 index 0000000..e096255 --- /dev/null +++ b/DATE.INC @@ -0,0 +1,60 @@ +; ======= DATE.INC =================================================== +; This file contains release numbers and dates, and +; a copyright notice, to be included in the keyboard driver +; in the keyboard DLL's, and at the end of the XLATxx.BIN +; (Ansi/Oem) files. +; +; ==================================================================== +; history -- some build dates -- most recent first. +; +; 18 feb 90 freeze +; 16 feb 90 1.62 +; 11 feb 90 1.61 +; 05 feb 90 1.60 +; 29 jan 90 1.59 +; 23 jan 90 1.58 +; 16 jan 90 1.57 +; 09 jan 90 1.56 +; 02 jan 90 1.55 +; 19 dec 89 1.54 +; 14 dec 89 1.53 +; 05 dec 89 1.52 beta +; 28 nov 89 1.51 +; 20 nov 89 1.50 +; 14 nov 89 1.49 +; 07 nov 89 1.48 +; 31 oct 89 1.47 +; 24 oct 89 1.46 +; 17 oct 89 1.45 +; 10 oct 89 1.44 +; 03 oct 89 1.43 +; 26 sep 89 1.42 +; 19 sep 89 1.41 +; 12 sep 89 1.40 +; 07 sep 89 1.39 +; 27 aug 89 1.38 beta +; 22 aug 89 1.37 +; 15 aug 89 1.36 +; 08 aug 89 1.35 +; 02 aug 89 1.34 +; 20 jul 89 1.33 +; 18 jul 89 1.32 +; 13 jul 89 1.31 +; 7 jul 89 1.30 +; 29 jun 89 1.29 +; 22 jun 89 1.28 +; 26 may 89 1.24 +; 10 may 89 1.22 +; 20 jan 89 1.13 +; +; ==================================================================== + + db 0 + + public Date +Date db '',0 + + public Copyright + +Copyright db 'Copyright (C) 1983-1990 Microsoft Corp. All Rights Reserved.',0 + diff --git a/GETKBD.ASM b/GETKBD.ASM new file mode 100644 index 0000000..51b357e --- /dev/null +++ b/GETKBD.ASM @@ -0,0 +1,497 @@ +; ******* GetKbd.asm ****************************************** +; +; Copyright (C) 1989-1990 by Microsoft Corporation. +; +; Contains GetKbdTable() function to initialize keyboard +; tables. +; +; The scancode-to-virtual-keycode table keyTrTab[] in +; the driver is patched (including the 'X1-X2' swap for +; the AT keyboard) according to tables in this DLL. +; +; The tables in the data segment of this module are updated +; according to the keyboard type, and then the pointers and +; counts in the driver are updated accordingly. +; +; ************************************************************* +; History +; +; 08 jan 89 peterbe ifdef's for Ericsson/Nokia range +; checking (only types 1..4 if no +; Ericsson!) +; +; 17 aug 89 peterbe externB X1,X2 in ifdef! +; +; 03 aug 89 peterbe Add WEP() function. +; +; 18 jul 89 peterbe Use __ROMBIOS selector when testing for +; OLIVETTI copyright, in X1X2 code. +; +; 06 apr 89 peterbe Corrected documentation of parameters. +; +; 13 feb 89 peterbe Removed commented-out text. +; +; 09 feb 89 peterbe Added DATE.INC to code segment. +; Rewrote X1X2 code so we don't write +; into CS! +; +; 26 jan 89 peterbe Removed code for updating XLAT tables. +; (Oem/Ansi). +; +; 20 sep 88 peterbe Removed some unused data structures. +; +; 19 sep 88 peterbe Changing patching so it doesn't write +; in DLL's CODE segment. Format of +; 'header' changed slightly to facilitate +; this. Overlay type, sizes in header +; AFTER copying, with data pointed to +; by BegPatches[TableType-1]. +; 08 sep 88 peterbe Finished CODE seg aliasing. Need to +; add code to release alias when done! +; 07 sep 88 peterbe Beginning to add code for aliasing +; CODE segment, which is written to! +; 25 aug 88 peterbe Removed debug string. +; 11 aug 88 peterbe Added code for patching szSGCaps, +; fKeyType, TableType. +; 08 aug 88 peterbe Added X1/X2 swap code. This requires +; conditional assembly flag X1X2 set +; for ALL BUT USA TABLES! +; 05 aug 88 peterbe Adding more code/data for patching. +; 04 aug 88 peterbe Adding code/data for patching. +; 29 jul 88 peterbe Making single-keyboard version work +; 28 jul 88 peterbe Created +; +; ************************************************************* + +include cmacros.inc + +extrn __ROMBIOS:abs ; selector for real segment 0F000H + +sBegin DATA + +; ************************************************************* +; +; Things to patch in tables in DATA segment. +; +; ************************************************************* + + externB PatchATran4 + externB VarAscCtrlVK + externB VarAscCtrl + externB AscCtlAltVK + externB AscCtlAlt + externB AscShCtlAltVK + externB AscShCtlAlt + externB Morto + externB MortoCode + externB CapitalTable + +sEnd DATA + + +; ************************************************************* +; +sBegin CODE ; Beginning of code segment +assumes CS,CODE +assumes DS,DATA + +; ************************************************************* +; +; Externals in CODE segment +; +; ************************************************************* + +; Externals for offsets of patch tables in kbdXX.asm + + externW szPatchATran + externW PatchATran + + externW szPatchACtrl + externW PatchACtrlVK + externW PatchACtrl + + externW szPatchACtlAlt + externW PatchACtlAltVK + externW PatchACtlAlt + + externW szPatchAShCtlAlt + externW PatchAShCtlAltVK + externW PatchAShCtlAlt + + externW szPatchMortoVK + externW PatchMortoVK + + externW szPatchMortoCode + externW PatchMortoCode + + externW szPatchCapital + externW PatchCapital + +; Externals for patching keyTrTab. + + externW + externB + externW + +ifdef X1X2 + externB ; used for non-US AT keyboards. +endif + + externB Patch102 ; entry in PatchIndices[] for + ; key 102 .. must change for Nokia 6. + +; Externals for copying the header + + externW + externB + +; Externals for patching the header. + + externB HeaderBeg ; base of table + + externW szAscTran ; doesn't change + + ; The following values are changed in the header in the driver, after + ; the table is copied. + + externW szAscControl ; does change + externW szAscCtlAlt ; does change + externW szAscShCtlAlt ; does change + + externW szMorto ; does change + externW szDeadKey ; does change + externW szSGCaps ; does change + externW szCapital ; does change + + externB fKeyType ; flags mainly for Enhanced kbd. + externB TableType ; == KeyType + + externW BegPatches ; offsets of szN tables for patching + ; header. + +; ************************************************************* +; +; Patch table for main patch loop. +; +; This consists of a series of 4-word entries, terminated +; by a 0 word. These look like +; +; dw CODEoffset <6-word table of patch sizes> +; dw CODEoffset <6-word table of patch source offsets> +; dw DATAoffset +; dw CODEoffset <(destination) size field in header> +; +; In certain cases, the size field entry is a dummy value +; because it isn't needed, or a temporary value, since the +; value needs to be adjusted. +; +; ************************************************************* + + +MainPatchTable label word + + ; main shifted/unshifted translation table + dw CODEoffset szPatchATran + dw CODEoffset PatchATran + dw DATAoffset PatchATran4 + + ; Control key VK table + dw CODEoffset szPatchACtrl + dw CODEoffset PatchACtrlVK + dw DATAoffset VarAscCtrlVK + + + ; control key translated table + dw CODEoffset szPatchACtrl + dw CODEoffset PatchACtrl + dw DATAoffset VarAscCtrl + + ; control-alt VK table + dw CODEoffset szPatchACtlAlt + dw CODEoffset PatchACtlAltVK + dw DATAoffset AscCtlAltVK + + + ; control-alt translated table + dw CODEoffset szPatchACtlAlt + dw CODEoffset PatchACtlAlt + dw DATAoffset AscCtlAlt + + ; + ; shift-control-alt VK table + dw CODEoffset szPatchAShCtlAlt + dw CODEoffset PatchAShCtlAltVK + dw DATAoffset AscShCtlAltVK + + + ; shift-control-alt translated table + dw CODEoffset szPatchAShCtlAlt + dw CODEoffset PatchAShCtlAlt + dw DATAoffset AscShCtlAlt + + ; Dead-key VK+shift table patches + dw CODEoffset szPatchMortoVK + dw CODEoffset PatchMortoVK + dw DATAoffset Morto + + + ; Dead-key translated table patches + dw CODEoffset szPatchMortoCode + dw CODEoffset PatchMortoCode + dw DATAoffset MortoCode + + ; Capital table patches. + dw CODEoffset szPatchCapital + dw CODEoffset PatchCapital + dw DATAoffset CapitalTable + + dw 0 ; terminator. + +; Date, so we can verify that KEYBOARD.DRV and KBDDLL.MOD come from same +; build! .. +include date.inc + +; ************************************************************* +; +; GetKbdTable() +; +; Is called with +; +; parmW: Keyboard type 1: XT, M24 83-key +; 2: Olivetti M24 102-key 'ICO' +; 3: AT 84- or 86-key +; 4: RT Enhanced 101- or 102-key +; Old Ericsson keyboards: +; 5: Nokia (aka Ericsson) 1050 +; 6: Nokia +; +; parmD: far Pointer to keyTrTab[] in driver +; +; parmD: far Pointer to the header for the translation tables +; +; The tables are patched, and various data are copied to +; the driver, as described below. +; +; This returns a FAR pointer to this DLL's DATA segment in DX:AX +; (AX is 0). +; +; This routine is in a LOADONCALL DISPOSABLE segment, so +; its memory may be reclaimed. The DATA segment is fixed. +; +; ************************************************************* + +cProc GetKbdTable,, + + ParmW nKeyType ; keyboard type 1..6 + ParmD lpKeyTrans ; pointer to keyTrTab[] in driver. + ParmD lpHeader ; pointer to set of pointers/sizes in + ; TABS.ASM + + localD pProc ; pointer to + localW hKernel ; handle for kernel.exe + + localW bxIndex ; index calculated from nKeyType + + +cBegin GetKbdTable + + ; all string operations go UP! + + cld + + ; Make patches to tables in data segment, depending on keyboard + ; type. + ; Begin by setting up segment registers and checking the keyboard + ; type. + + push ds ; save DS + push ds + pop es ; ES -> DATA + push cs + pop ds ; DS -> CODE (or alias) + +assumes CS,CODE +assumes DS,CODE ; or alias for CODE! + + mov bx,nKeyType ; get keyboard type + + dec bx ; make BX a WORD index: + shl bx,1 ; [bx] = (nKeyType-1) * 2 + mov bxIndex,bx ; save for later + +ifdef NOKIA ; support old Ericsson kbd's? + cmp bx,6 ; don't patch type 4 + je PatchDone + cmp bx,10 ; .. or > 6 + ja PatchDone +else ; IBM, Olivetti-compatible only: + cmp bx,6 ; don't patch type 4 + jae PatchDone ; or greater! +endif + + mov di,CODEoffset MainPatchTable + + ; in the most of this loop, DI points to the current block + ; in MainPatchTable, and BX is an index to the size and + ; source-address tables. + +PatchLoop: + mov si,word ptr[di] ; base of size array + or si,si ; 0 value terminates + jz PatchEnd + + mov cx,word ptr[si+bx] ; get count from table + cmp cx,0 + jle PatchNext ; do nothing if [CX] negative + + ; [CX] > 0, so copy an array: + mov si,word ptr[di+2] ; get base of source array + mov si,word ptr[si+bx] ; get source address + push di ; save old DI + mov di,word ptr[di+4] ; get destination offset + rep movsb ; copy the data! + pop di ; restore old DI + +PatchNext: + add di,6 ; move DI to next parameter + jmp PatchLoop ; block in MainPatchTable + +PatchEnd: +PatchDone: + pop ds + +assumes CS,CODE +assumes DS,DATA + + ; Patch the keyboard driver's keyTrTab scancode-to-VK-code translation + ; table. Again, this depends on the keyboard type. + ; Translations for scan codes 29h and 2bh are swapped on AT-type + ; keyboards for non-Olivetti systems. + +;DoVKPatch: + + push ds ; save DS, + push cs ; set DS=CS + pop ds + assumes DS,CODE + + mov cx,nIndices ; get count + + ; now we set up to patch keyTrTab[] + +ifdef NOKIA + cmp bxIndex,10 ; keyboard type in range 1..5? + jb KeyTypeOk ; 1..4 + je KeyTypeNok6 +else + cmp bxIndex,6 ; kbd type in range 1..4? + jbe KeyTypeOk +endif + +ZerKeyType: + xor bx,bx ; too big, clear index + mov bxIndex,bx ; and save it +ifdef NOKIA + jmp short KeyTypeOk + +KeyTypeNok6: ; for Nokia 6, change key + mov Patch102,98 ; 98 instead of 86 +endif + +KeyTypeOk: + mov si,[TransPatches+bx] ; set source for this key. type + les di,lpKeyTrans ; set dest. to keyTrTab[0] + xor bx,bx ; clear index to PatchIndices + + ; Now we patch keyTrTab[]. + ; this loop uses AL, BX (2 ways!), CX, SI, DI, DS, ES !! + ; Index into keyTrTab[] is obtained from PatchIndices[] +VKloop: + push bx ; save index to PatchIndices[]. + mov bl,[PatchIndices+bx] ; BH remains 0. + lodsb ; move * (DS:SI++) to + mov es:[di+bx],al ; * (DS:(DI+PatchIndices[n++])) + pop bx ; BX is index to PatchIndices, + inc bl ; increment index. + loop VKloop + + ; Handle the famous X1/X2 scancode swap for the AT-type keyboard + ; (for non-US keyboards only -- this is controled by 'X1X2' + ; conditional assembly flag, which should be set for all but + ; US keyboard). We don't do this for Olivetti AT (M28) keyboards. + +ifdef X1X2 + mov ax,__ROMBIOS ; Is this an Olivetti system? + mov es,ax ; get ROM copyright message -- + mov ax,es:[0c050h] ; 'LO' in AX if it's Olivetti + cmp bxIndex,4 ; AT-type (3) keyboard? + jne NoX1X2 ; if not, no swap. + cmp ax,'LO' ; Olivetti ROM? + je NoX1X2 ; if so, no swap. + +SwapX1X2: + ; exchange X1, X2 entries in + xor ah,ah ; keyTrTab[] in driver. + mov al,X1 ; get X1's index + mov si,ax ; -> SI + mov al,X2 ; get X2's index + mov di,ax ; -> DI + les bx,lpKeyTrans ; ES:BX -> keyTrTab[0] + mov al,es:[BX+SI] ; swap keyTrTab[X1] + xchg al,es:[BX+DI] ; and + mov es:[BX+SI],al ; keyTrTab[X2]. +NoX1X2: + +endif ; X1X2 + + ; Copy the pointers and sizes in the header to the driver + + mov cx,szHeader ; get byte count + mov si,CODEoffset headerBeg ; set source + les di,lpHeader ; set destination + rep movsb ; copy the header. + + ; If the table type is not 4, overlay the first part of the + ; header with values in szN (see BegPatches[] in a keyboard table + ; file) + + mov bx,bxIndex ; (nKeyType - 1) * 2 + cmp bx,6 ; enhanced keyboard? + je NoPatchHeaderSizes ; skip if type 4 + mov si,[BegPatches+bx] ; get offset of patches + mov cx,16 ; size of szN[] + les di,lpHeader ; set destination + rep movsb ; copy the first part +NoPatchHeaderSizes: ; of the header. + + ; and we're done. Return a FAR pointer to this DLL's DATA segment. + +GKTexit: + pop ds + assumes DS,DATA + + xor ax,ax ; AX = 0 + push ds + pop dx ; DX = DATA + +GKTend: + +cEnd GetKbdTable + +; WEP(): This function is called when the DLL is loaded or unloaded. +; +; in our case, we do nothing but return. + +cProc WEP, + +;; wParam foo ; for reference.. this has 1 param. + +cBegin nogen + + ret 2 ; flush the parameter on exit + +cEnd nogen + +sEnd CODE + +end diff --git a/KBDQWFR.ASM b/KBDQWFR.ASM new file mode 100644 index 0000000..0da395e --- /dev/null +++ b/KBDQWFR.ASM @@ -0,0 +1,1729 @@ +; 'kbdqwfr.asm', Windows 3.00 keyboard table based on 'kbdus.asm' +; +; 'kbdus.asm' Windows 3.00 keyboard table file based on: +; 'us1.wk2', 'us2.wk2', 'us1.wk2', 'us4.wk2', 'us5.wk2', 'us6.wk2' +; + +; ******************************************************** +; Copyright (C) 1989-1990 by Microsoft Corporation. +; ******************************************************** + +; USA keyboards. This DLL is normally used only for types 2, 5, and 6 +; keyboards, but may be used for IBM-compatible types 1,3, and 4. + +; History +; 08 jan 90 peterbe Nokia ifdef +; 06 sep 89 peterbe Commented out VK_EXECUTE translation. +; 14 jul 89 peterbe SHIFT + VK_TAB ==> ascii TAB now. + +; Table 3 (for 'AT' 84 or 86-key keyboards) is the same as table 1 +; ******************************************************** +; +; Keyboard translation table for Windows 3.00 +; +; if INDRIVER is set, this is just an include file with the actual +; tables in it, to be included in the TABS.ASM file. +; +; Otherwise, this contains the type 4 (Enhanced keyboard) translation +; tables for some keyboard table DLL, and the patch tables required +; to alter the above tables for all other keyboard types (1..6). +; +; ******************************************************** + +; ******************************************************** +; These equates determine which dead key table +; translations are used in any keyboard for this +; country. +; ******************************************************** + +; define DGRAVE DACUTE DCIRCUMFLEX DUMLAUT DTILDE DCEDILLA +; to include the translations for those accents. + + ; No grave deadkeys + ; No acute deadkeys + ; No circumflex deadkeys + ; No umlaut deadkeys + ; No tilde deadkeys + ; No cedilla deadkeys + +; ******************************************************** +; define whether XT (type 1) and AT (type 3) tables are the same: +; ******************************************************** + +ATSAME equ 1 + +; ******************************************************** +; +; definitions of deadkey accent characters for this country. +; Tilde is always '~', circumflex is always '^'. +; Umlaut and acute may vary for different countries. +; +; ******************************************************** + +umlaut equ 022h +acute equ 0b4h +grave equ 060h +circumflex equ '^' +tilde equ '~' +cedilla equ 0b8h + + +; ******************************************************** +; +; The CODE segment of this file contains information +; for patching the tables in the DATA segment. +; +; ******************************************************** + +include keyboard.inc +include vkwin.inc +include vkoem.inc + +; macros for translation table entry. +include trans.inc + +if1 +%out +%out .. KBDUS.ASM: USA +endif + + +sBegin CODE + + assumes ds,DATA + + +; ******************************************************** +; +; Tables to patch the keyTrTab table in the driver. +; These tables are fixed in size. +; +; ******************************************************** + +; Numbers of entries to patch + + public nIndices, PatchIndices, TransPatches + public X1, X2, Patch102 + +nIndices dw CODEoffset IndicesEnd - CODEoffset PatchIndices + +; This table maps an index to TransPatchN into the corresponding +; entry in keyTrTab in the driver: + +PatchIndices label byte + db 12,13,16,17,21,26,27,30,39,40 + X1 label byte + db 41 + X2 label byte + db 43,44,50,51,52,53 + Patch102 label byte + db 86 ; 98 for Nokia type 6 + db 87,88 ; Enhanced VK_F11, VK_F12 +IndicesEnd label byte + +; patch values for keyTrTab. + +TransPatches label word + + dw CODEoffset TransPatch1 ; 1 + dw CODEoffset TransPatch2 ; 2 + dw CODEoffset TransPatch3 ; 3 + dw CODEoffset TransPatch4 ; 4 +ifdef NOKIA + dw CODEoffset TransPatch5 ; 5 + dw CODEoffset TransPatch6 ; 6 +endif + +; may be all the same -- but usually not! + +TransPatch1 label byte ; This is for type 1 + ; Same as next +TransPatch3 label byte ; This is for type 3 + db VK_OEM_MINUS ; 0ch 12 + db VK_OEM_PLUS ; 0dh 13 + db VK_Q ; 010h 16 + db VK_W ; 011h 17 + db VK_Y ; 015h 21 + db VK_OEM_4 ; 01ah 26 + db VK_OEM_6 ; 01bh 27 + db VK_A ; 01eh 30 + db VK_OEM_1 ; 027h 39 + db VK_OEM_7 ; 028h 40 + db VK_OEM_3 ; 029h 41 + db VK_OEM_5 ; 02bh 43 + db VK_Z ; 02ch 44 + db VK_M ; 032h 50 + db VK_OEM_COMMA ; 033h 51 + db VK_OEM_PERIOD ; 034h 52 + db VK_OEM_2 ; 035h 53 + db VK_OEM_102 ; 056h 86 + db VK_F11 ; 057h 87 + db VK_F12 ; 058h 88 + +TransPatch2 label byte ; This is for type 2 (ICO) + db VK_OEM_MINUS ; 0ch 12 + db VK_OEM_4 ; 0dh 13 + db VK_Q ; 010h 16 + db VK_W ; 011h 17 + db VK_Y ; 015h 21 + db VK_OEM_6 ; 01ah 26 + db VK_OEM_1 ; 01bh 27 + db VK_A ; 01eh 30 + db VK_OEM_PLUS ; 027h 39 + db VK_OEM_3 ; 028h 40 + db VK_OEM_7 ; 029h 41 + db VK_OEM_5 ; 02bh 43 + db VK_Z ; 02ch 44 + db VK_M ; 032h 50 + db VK_OEM_COMMA ; 033h 51 + db VK_OEM_PERIOD ; 034h 52 + db VK_OEM_2 ; 035h 53 + db VK_ICO_HELP ; 056h 86 + db VK_RETURN ; 057h 87 + db VK_LEFT ; 058h 88 + +TransPatch4 label byte ; This is for type 4 + db VK_OEM_MINUS ; 0ch 12 + db VK_OEM_PLUS ; 0dh 13 + db VK_Q ; 010h 16 + db VK_W ; 011h 17 + db VK_Y ; 015h 21 + db VK_OEM_4 ; 01ah 26 + db VK_OEM_6 ; 01bh 27 + db VK_A ; 01eh 30 + db VK_OEM_1 ; 027h 39 + db VK_OEM_7 ; 028h 40 + db VK_OEM_3 ; 029h 41 + db VK_OEM_5 ; 02bh 43 + db VK_Z ; 02ch 44 + db VK_M ; 032h 50 + db VK_OEM_COMMA ; 033h 51 + db VK_OEM_PERIOD ; 034h 52 + db VK_OEM_2 ; 035h 53 + db VK_OEM_102 ; 056h 86 + db VK_F11 ; 057h 87 + db VK_F12 ; 058h 88 + +ifdef NOKIA +TransPatch5 label byte + db VK_OEM_MINUS ; 0ch 12 + db VK_OEM_PLUS ; 0dh 13 + db VK_Q ; 010h 16 + db VK_W ; 011h 17 + db VK_Y ; 015h 21 + db VK_OEM_4 ; 01ah 26 + db VK_OEM_6 ; 01bh 27 + db VK_A ; 01eh 30 + db VK_OEM_1 ; 027h 39 + db VK_OEM_3 ; 028h 40 + db VK_OEM_7 ; 029h 41 + db VK_OEM_5 ; 02bh 43 + db VK_Z ; 02ch 44 + db VK_M ; 032h 50 + db VK_OEM_COMMA ; 033h 51 + db VK_OEM_PERIOD ; 034h 52 + db VK_OEM_2 ; 035h 53 + db 0ffh ; 056h 86 + db 0ffh ; 057h 87 + db 0ffh ; 058h 88 + +TransPatch6 label byte ; This is for type 6 (NOKIA) + db VK_OEM_MINUS ; 0ch 12 + db VK_OEM_PLUS ; 0dh 13 + db VK_Q ; 010h 16 + db VK_W ; 011h 17 + db VK_Y ; 015h 21 + db VK_OEM_4 ; 01ah 26 + db VK_OEM_6 ; 01bh 27 + db VK_A ; 01eh 30 + db VK_OEM_1 ; 027h 39 + db VK_OEM_3 ; 028h 40 + db VK_OEM_7 ; 029h 41 + db VK_OEM_5 ; 02bh 43 + db VK_Z ; 02ch 44 + db VK_M ; 032h 50 + db VK_OEM_COMMA ; 033h 51 + db VK_OEM_PERIOD ; 034h 52 + db VK_OEM_2 ; 035h 53 + db 0ech ; 056h 86 + db VK_HELP ; 057h 87 + db VK_OEM_102 ; 058h 88 +endif + +; End of keyTrTab patches. + +; ******************************************************** +; +; Everything from HeaderBeg to HeaderEnd gets copied to variables +; with the same names in the driver. +; +; ******************************************************** + + public szHeader, HeaderBeg + public szAscTran, szAscControl, szAscCtlAlt, szAscShCtlAlt + + public pCapital, szCapital + public pMorto, szMorto, pMortoCode + public szDeadKey, pDeadKeyCode, pDeadChar + public szSGCaps, pSGCapsVK, pSGTrans + + public VirtAdr, AsciiTab + +szHeader dw CODEoffset HeaderEnd - CODEoffset HeaderBeg + +HeaderBeg label byte + +; ******************************************************** +; +; Keyboard table type +; +; This value is patched after the header is copied. +; +; ******************************************************** + + public TableType + +TableType db 4 + + +; ******************************************************** +; +; This flags special features like caps lock. +; +; kbAltGr = right alt key is ctrl-alt +; kbShiftLock = has shift lock instead of caps lock +; +; This value is patched after the header +; is copied to the driver. +; +; ******************************************************** + + public fKeyType + +fKeyType label byte ; db kbAltGr+kbShiftLock + db 0 + kbAltGr + +; ******************************************************** +; +; Table sizes (Number of bytes in search table for a particular +; translation). +; +; Order of entries must be maintained! +; First 4 entries are accessed by indexing based on shift state. +; +; Also, the whole list of pointers is transferred to the code module +; with one REP MOVSB instruction. +; +; If the table type is not 4, the sizes at the beginning, and the +; table type and flags, are updated after the header is copied. +; +; ******************************************************** + +; These sizes may vary depending on the keyboard type. + +szAscTran dw DATAoffset AscTranEnd - DATAoffset AscTranVK +szAscControl dw DATAoffset AscControlEnd - DATAoffset AscControlVK +szAscCtlAlt dw DATAoffset AscCtlAltEnd - DATAoffset AscCtlAltVK +szAscShCtlAlt dw DATAoffset AscShCtlAltEnd - DATAoffset AscShCtlAltVK + +szMorto dw DATAoffset MortoEnd - DATAoffset Morto +szSGCaps dw DATAoffset SGCapsEnd - DATAoffset SGCapsVK + +szCapital dw DATAoffset CapitalEnd - DATAoffset CapitalTable + +; These sizes are fixed for a particular country. +szDeadKey dw DATAoffset DeadKeyEnd - DATAoffset DeadKeyCode + +; ******************************************************** +; +; Addresses of virtual key code arrays for various shifts. +; +; ******************************************************** + +VirtAdr label word + dw DATAoffset AscTranVK ; shifted, unshifted + dw DATAoffset AscControlVK ; Control + dw DATAoffset AscCtlAltVK ; Control-Alt + dw DATAoffset AscShCtlAltVK ; Shift-Control-Alt + +pMorto dw DATAoffset Morto +pDeadKeyCode dw DATAoffset DeadKeyCode +pSGCapsVK dw DATAoffset SGCapsVK + +pCapital dw DATAoffset CapitalTable + +; ******************************************************** +; +; addresses of translated character arrays for various shifts. +; +; ******************************************************** + +AsciiTab label word + dw DATAoffset AscTran ; shifted, unshifted + dw DATAoffset AscControl ; Control + dw DATAoffset AscCtlAlt ; Control-Alt + dw DATAoffset AscShCtlAlt ; Shift-Control-Alt + +pMortoCode dw DATAoffset MortoCode +pDeadChar dw DATAoffset DeadChar +pSGTrans dw DATAoffset SGTrans + + +; ******************************************************** +; +; End of Header. +; ******************************************************** + + public HeaderEnd + +HeaderEnd label byte + +; ******************************************************** +; Patching tables +; ******************************************************** + +; ******************************************************** +; Patches for flags and sizes at beginning of header. +; +; These tables overlay the beginning of the 'header' +; in the driver, after the header has been copied, +; if the keyboard type is not 4. +; ******************************************************** + + public BegPatches + +BegPatches label word + dw CODEoffset sz1 + dw CODEoffset sz2 + dw CODEoffset sz3 + dw 0 +ifdef NOKIA + dw CODEoffset sz5 + dw CODEoffset sz6 +endif + +; Each one of these tables is 8 words long. + +sz1 label word + db 1 ; overlays TableType + db 0 + dw DATAoffset AscTranEnd - DATAoffset AscTranVK + dw 6 + CODEoffset PatchACtrl1End - CODEoffset PatchACtrl1VK + dw CODEoffset PatchACtlAlt1End - CODEoffset PatchACtlAlt1VK + dw CODEoffset PatchAShCtlAlt1End - CODEoffset PatchAShCtlAlt1VK + dw CODEoffset PatchMortoEnd1 - CODEoffset PatchMorto1 + dw 0 ; SGCaps size = 0 + dw CODEoffset PatchCapEnd1 - CODEoffset PatchCap1 + +sz2 label word + db 2 + db 0 + dw DATAoffset AscTranEnd - DATAoffset AscTranVK + dw 6 + CODEoffset PatchACtrl2End - CODEoffset PatchACtrl2VK + dw CODEoffset PatchACtlAlt2End - CODEoffset PatchACtlAlt2VK + dw CODEoffset PatchAShCtlAlt2End - CODEoffset PatchAShCtlAlt2VK + dw CODEoffset PatchMortoEnd2 - CODEoffset PatchMorto2 + dw 0 ; SGCaps size = 0 + dw CODEoffset PatchCapEnd2 - CODEoffset PatchCap2 + +sz3 label word + db 3 + db 0 + dw DATAoffset AscTranEnd - DATAoffset AscTranVK + dw 6 + CODEoffset PatchACtrl3End - CODEoffset PatchACtrl3VK + dw CODEoffset PatchACtlAlt3End - CODEoffset PatchACtlAlt3VK + dw CODEoffset PatchAShCtlAlt3End - CODEoffset PatchAShCtlAlt3VK + dw CODEoffset PatchMortoEnd3 - CODEoffset PatchMorto3 + dw 0 ; SGCaps size = 0 + dw CODEoffset PatchCapEnd3 - CODEoffset PatchCap3 + +ifdef NOKIA +sz5 label word + db 5 + db 0 + dw DATAoffset AscTranEnd - DATAoffset AscTranVK + dw 6 + CODEoffset PatchACtrl5End - CODEoffset PatchACtrl5VK + dw CODEoffset PatchACtlAlt5End - CODEoffset PatchACtlAlt5VK + dw CODEoffset PatchAShCtlAlt5End - CODEoffset PatchAShCtlAlt5VK + dw CODEoffset PatchMortoEnd5 - CODEoffset PatchMorto5 + dw 0 ; SGCaps size = 0 + dw CODEoffset PatchCapEnd5 - CODEoffset PatchCap5 + +sz6 label word + db 6 + db 0 + dw DATAoffset AscTranEnd - DATAoffset AscTranVK + dw 6 + CODEoffset PatchACtrl6End - CODEoffset PatchACtrl6VK + dw CODEoffset PatchACtlAlt6End - CODEoffset PatchACtlAlt6VK + dw CODEoffset PatchAShCtlAlt6End - CODEoffset PatchAShCtlAlt6VK + dw CODEoffset PatchMortoEnd6 - CODEoffset PatchMorto6 + dw 0 ; SGCaps size = 0 + dw CODEoffset PatchCapEnd6 - CODEoffset PatchCap6 +endif + +; ******************************************************** +; +; Patches to 'normal' AsciiTran. +; +; This translation table is fixed in size, so no size +; adjustment is necessary. +; +; The patches are just an overlay of the translations +; of VK_0 .. VK_DECIMAL in AscTran. +; +; One of the following arrays is just copied to +; PatchATran4. +; +; These may seem excessively large and redundant, but +; it's all disposable! +; +; ******************************************************** + + public szPatchATran + public PatchATran + +szPatchATran label word + ; all the same size, but repeat for code simplicity. + dw CODEoffset PatchATran1End - CODEoffset PatchATran1 + dw CODEoffset PatchATran1End - CODEoffset PatchATran1 + dw CODEoffset PatchATran1End - CODEoffset PatchATran1 + dw 0 +ifdef NOKIA + dw CODEoffset PatchATran1End - CODEoffset PatchATran1 + dw CODEoffset PatchATran1End - CODEoffset PatchATran1 +endif + +PatchATran label word + + dw CODEoffset PatchATran1 + dw CODEoffset PatchATran2 + dw CODEoffset PatchATran3 + dw 0 +ifdef NOKIA + dw CODEoffset PatchATran5 + dw CODEoffset PatchATran6 +endif + + +PatchATran1 label word ; XT table + +ifdef ATSAME +PatchATran3 label word +endif + + db '0', ')' ; VK_0 + db '1', '!' ; VK_1 + db '2', '@' ; VK_2 + db '3', '#' ; VK_3 + db '4', '$' ; VK_4 + db '5', '%' ; VK_5 + db '6', '^' ; VK_6 + db '7', '&' ; VK_7 + db '8', '*' ; VK_8 + db '9', '(' ; VK_9 + db ',', '<' ; VK_OEM_COMMA + db '.', '>' ; VK_OEM_PERIOD + db '-', '_' ; VK_OEM_MINUS + db '=', '+' ; VK_OEM_PLUS + db ';', ':' ; VK_OEM_1 + db '/', '?' ; VK_OEM_2 + db '`', '~' ; VK_OEM_3 + db '[', '{' ; VK_OEM_4 + db '\', '|' ; VK_OEM_5 + db ']', '}' ; VK_OEM_6 + db 027h, '"' ; VK_OEM_7 + db -1, -1 ; VK_OEM_8 + db -1, -1 ; VK_OEM_102 + db '.', '.' ; VK_DECIMAL + +PatchATran1End label word + +ifndef ATSAME +PatchATran3 label word +; (Same as XT) + +endif + +PatchATran2 label word ; ICO table + + db '0', '_' ; VK_0 + db '1', '!' ; VK_1 + db '2', '"' ; VK_2 + db '3', '#' ; VK_3 + db '4', '$' ; VK_4 + db '5', '%' ; VK_5 + db '6', '&' ; VK_6 + db '7', 027h ; VK_7 + db '8', '(' ; VK_8 + db '9', ')' ; VK_9 + db ',', '<' ; VK_OEM_COMMA + db '.', '>' ; VK_OEM_PERIOD + db '-', '=' ; VK_OEM_MINUS + db ';', '+' ; VK_OEM_PLUS + db '[', '{' ; VK_OEM_1 + db '/', '?' ; VK_OEM_2 + db ':', '*' ; VK_OEM_3 + db '^', '~' ; VK_OEM_4 + db '\', '|' ; VK_OEM_5 + db '@', '`' ; VK_OEM_6 + db ']', '}' ; VK_OEM_7 + db -1, -1 ; VK_OEM_8 + db -1, -1 ; VK_OEM_102 + db '.', '.' ; VK_DECIMAL + +ifdef NOKIA +PatchATran5 label word + + db '0', ')' ; VK_0 + db '1', '!' ; VK_1 + db '2', '@' ; VK_2 + db '3', '#' ; VK_3 + db '4', '$' ; VK_4 + db '5', '%' ; VK_5 + db '6', '^' ; VK_6 + db '7', '&' ; VK_7 + db '8', '*' ; VK_8 + db '9', '(' ; VK_9 + db ',', '<' ; VK_OEM_COMMA + db '.', '>' ; VK_OEM_PERIOD + db '-', '_' ; VK_OEM_MINUS + db '=', '+' ; VK_OEM_PLUS + db ';', ':' ; VK_OEM_1 + db '/', '?' ; VK_OEM_2 + db 027h, '"' ; VK_OEM_3 + db '[', '{' ; VK_OEM_4 + db '\', '|' ; VK_OEM_5 + db ']', '}' ; VK_OEM_6 + db '`', '~' ; VK_OEM_7 + db -1, -1 ; VK_OEM_8 + db -1, -1 ; VK_OEM_102 + db '.', '.' ; VK_DECIMAL + +PatchATran6 label word + + db '0', ')' ; VK_0 + db '1', '!' ; VK_1 + db '2', '@' ; VK_2 + db '3', '#' ; VK_3 + db '4', '$' ; VK_4 + db '5', '%' ; VK_5 + db '6', '^' ; VK_6 + db '7', '&' ; VK_7 + db '8', '*' ; VK_8 + db '9', '(' ; VK_9 + db ',', '<' ; VK_OEM_COMMA + db '.', '>' ; VK_OEM_PERIOD + db '-', '_' ; VK_OEM_MINUS + db '=', '+' ; VK_OEM_PLUS + db ';', ':' ; VK_OEM_1 + db '/', '?' ; VK_OEM_2 + db 027h, '"' ; VK_OEM_3 + db '[', ']' ; VK_OEM_4 + db '<', '>' ; VK_OEM_5 + db '\', '|' ; VK_OEM_6 + db '{', '}' ; VK_OEM_7 + db -1, -1 ; VK_OEM_8 + db '`', '~' ; VK_OEM_102 + db '.', '.' ; VK_DECIMAL +endif + + +; End of patches for AsciiTran. + +; ******************************************************** +; +; For the other tables, the number of entries varies +; among the various keyboard types, so the size +; table szXXXXX entry must be adjusted in the +; header before the header is copied. +; +; If any table is longer than the corresponding table +; for the Type 4 keyboard, padding must be put at the +; end of that table in the DATA segment to allow +; for overwriting with additional entries. +; +; ******************************************************** + + +; ******************************************************** +; +; Patches to 'AscControl' table. +; +; The overlays for this table are in both the 'key' +; list AscControlVK, and the translated Ascii list +; 'AscControl'. Also, they first part of AscControlVK +; and AscControl are fixed -- the changeable part +; of each array is labeled. +; +; ******************************************************** + + public szPatchACtrl + public PatchACtrlVK + public PatchACtrl + +szPatchACtrl label word + dw CODEoffset PatchACtrl1End - CODEoffset PatchACtrl1VK + dw CODEoffset PatchACtrl2End - CODEoffset PatchACtrl2VK + dw CODEoffset PatchACtrl3End - CODEoffset PatchACtrl3VK + dw 0 +ifdef NOKIA + dw CODEoffset PatchACtrl5End - CODEoffset PatchACtrl5VK + dw CODEoffset PatchACtrl6End - CODEoffset PatchACtrl6VK +endif + +PatchACtrlVK label word + + dw CODEoffset PatchACtrl1VK + dw CODEoffset PatchACtrl2VK + dw CODEoffset PatchACtrl1VK + dw 0 +ifdef NOKIA + dw CODEoffset PatchACtrl5VK + dw CODEoffset PatchACtrl6VK +endif + +PatchACtrl label word + + dw CODEoffset PatchACtrl1 + dw CODEoffset PatchACtrl2 + dw CODEoffset PatchACtrl1 + dw 0 +ifdef NOKIA + dw CODEoffset PatchACtrl5 + dw CODEoffset PatchACtrl6 +endif + + +; type 1 +; type 3 +IRP VKFLAG, <0, 1> + + klabels PatchACtrl1VK, PatchACtrl1, VKFLAG +ifdef ATSAME + klabels PatchACtrl3VK, PatchACtrl3, VKFLAG +endif + + ktrans VK_2 , 080h, VKFLAG + ktrans VK_6 , 09eh, VKFLAG + ktrans VK_OEM_4 , 01bh, VKFLAG + ktrans VK_OEM_5 , 01ch, VKFLAG + ktrans VK_OEM_6 , 01dh, VKFLAG + ktrans VK_OEM_MINUS, 09fh, VKFLAG + + klabdef PatchACtrl1End, VKFLAG +ifdef ATSAME + klabdef PatchACtrl3End, VKFLAG +endif + +ENDM + +ifndef ATSAME +; type 3 +IRP VKFLAG, <0, 1> + + klabels PatchACtrl3VK, PatchACtrl3, VKFLAG + +; (Same as XT) + + klabdef PatchACtrl3End, VKFLAG + +ENDM +endif + +; type 2 +IRP VKFLAG, <0, 1> + + klabels PatchACtrl2VK, PatchACtrl2, VKFLAG + + ktrans VK_0 , 09fh, VKFLAG + ktrans VK_6 , 09eh, VKFLAG + ktrans VK_OEM_1 , 01dh, VKFLAG + ktrans VK_OEM_5 , 01ch, VKFLAG + ktrans VK_OEM_6 , 01bh, VKFLAG + ktrans VK_OEM_MINUS, 01fh, VKFLAG + + klabdef PatchACtrl2End, VKFLAG + +ENDM + +ifdef NOKIA +; type 5 +IRP VKFLAG, <0, 1> + + klabels PatchACtrl5VK, PatchACtrl5, VKFLAG + + ktrans VK_6 , 09eh, VKFLAG + ktrans VK_OEM_4 , 01bh, VKFLAG + ktrans VK_OEM_5 , 01ch, VKFLAG + ktrans VK_OEM_6 , 01dh, VKFLAG + ktrans VK_OEM_MINUS, 01fh, VKFLAG + + klabdef PatchACtrl5End, VKFLAG + +ENDM + +; type 6 +IRP VKFLAG, <0, 1> + + klabels PatchACtrl6VK, PatchACtrl6, VKFLAG + + ktrans VK_6 , 09eh, VKFLAG + ktrans VK_OEM_4 , 01bh, VKFLAG + ktrans VK_OEM_6 , 01ch, VKFLAG + ktrans VK_OEM_MINUS, 01fh, VKFLAG + ktrans VK_OEM_102, 01dh, VKFLAG + + klabdef PatchACtrl6End, VKFLAG + +ENDM +endif + + +; ******************************************************** +; +; Patches to 'AscCtlAlt' table. +; +; For this and following tables, the whole table is +; copied when a keyboard type is selected. +; +; ******************************************************** + + public szPatchACtlAlt + public PatchACtlAltVK + public PatchACtlAlt + +szPatchACtlAlt label word + dw CODEoffset PatchACtlAlt1End - CODEoffset PatchACtlAlt1VK + dw CODEoffset PatchACtlAlt2End - CODEoffset PatchACtlAlt2VK + dw CODEoffset PatchACtlAlt3End - CODEoffset PatchACtlAlt3VK + dw 0 +ifdef NOKIA + dw CODEoffset PatchACtlAlt5End - CODEoffset PatchACtlAlt5VK + dw CODEoffset PatchACtlAlt6End - CODEoffset PatchACtlAlt6VK +endif + +PatchACtlAltVK label word + + dw CODEoffset PatchACtlAlt1VK + dw CODEoffset PatchACtlAlt2VK + dw CODEoffset PatchACtlAlt3VK + dw 0 +ifdef NOKIA + dw CODEoffset PatchACtlAlt5VK + dw CODEoffset PatchACtlAlt6VK +endif + +PatchACtlAlt label word + + dw CODEoffset PatchACtlAlt1 + dw CODEoffset PatchACtlAlt2 + dw CODEoffset PatchACtlAlt1 + dw 0 +ifdef NOKIA + dw CODEoffset PatchACtlAlt5 + dw CODEoffset PatchACtlAlt6 +endif + + +; type 1 +; type 3 +IRP VKFLAG, <0, 1> + + klabels PatchACtlAlt1VK, PatchACtlAlt1, VKFLAG +ifdef ATSAME + klabels PatchACtlAlt3VK, PatchACtlAlt3, VKFLAG +endif + +; Patch Control-Alt table for type 1 + + klabdef PatchACtlAlt1End, VKFLAG +ifdef ATSAME + klabdef PatchACtlAlt3End, VKFLAG +endif + +ENDM + +ifndef ATSAME +; type 2 +IRP VKFLAG, <0, 1> + + klabels PatchACtlAlt3VK, PatchACtlAlt3, VKFLAG + +; (Same as XT) + + klabdef PatchACtlAlt3End, VKFLAG + +ENDM +endif + +; type 2 +IRP VKFLAG, <0, 1> + + klabels PatchACtlAlt2VK, PatchACtlAlt2, VKFLAG + +; Patch Control-Alt table for type 2 + + klabdef PatchACtlAlt2End, VKFLAG + +ENDM + +ifdef NOKIA +; type 5 +IRP VKFLAG, <0, 1> + + klabels PatchACtlAlt5VK, PatchACtlAlt5, VKFLAG + +; Patch Control-Alt table for type 5 + ktrans VK_OEM_5 , '\', VKFLAG + + klabdef PatchACtlAlt5End, VKFLAG + +ENDM + +; type 6 +IRP VKFLAG, <0, 1> + + klabels PatchACtlAlt6VK, PatchACtlAlt6, VKFLAG + +; Patch Control-Alt table for type 6 + ktrans VK_OEM_5 , '\', VKFLAG + + klabdef PatchACtlAlt6End, VKFLAG + +ENDM +endif + + +; ******************************************************** +; +; Patches to 'AscShCtlAlt' table. +; +; ******************************************************** + + public szPatchAShCtlAlt + public PatchAShCtlAltVK + public PatchAShCtlAlt + +szPatchAShCtlAlt label word + dw CODEoffset PatchAShCtlAlt1End - CODEoffset PatchAShCtlAlt1VK + dw CODEoffset PatchAShCtlAlt2End - CODEoffset PatchAShCtlAlt2VK + dw CODEoffset PatchAShCtlAlt3End - CODEoffset PatchAShCtlAlt3VK + dw 0 +ifdef NOKIA + dw CODEoffset PatchAShCtlAlt5End - CODEoffset PatchAShCtlAlt5VK + dw CODEoffset PatchAShCtlAlt6End - CODEoffset PatchAShCtlAlt6VK +endif + +PatchAShCtlAltVK label word + + dw CODEoffset PatchAShCtlAlt1VK + dw CODEoffset PatchAShCtlAlt2VK + dw CODEoffset PatchAShCtlAlt1VK + dw 0 +ifdef NOKIA + dw CODEoffset PatchAShCtlAlt5VK + dw CODEoffset PatchAShCtlAlt6VK +endif + +PatchAShCtlAlt label word + + dw CODEoffset PatchAShCtlAlt1 + dw CODEoffset PatchAShCtlAlt2 + dw CODEoffset PatchAShCtlAlt1 + dw 0 +ifdef NOKIA + dw CODEoffset PatchAShCtlAlt5 + dw CODEoffset PatchAShCtlAlt6 +endif + + +; type 1 +; type 3 +IRP VKFLAG, <0, 1> + + klabels PatchAShCtlAlt1VK, PatchAShCtlAlt1, VKFLAG +ifdef ATSAME + klabels PatchAShCtlAlt3VK, PatchAShCtlAlt3, VKFLAG +endif + +; Patch Shift-Control-Alt table for type 1 + + klabdef PatchAShCtlAlt1End, VKFLAG +ifdef ATSAME + klabdef PatchAShCtlAlt3End, VKFLAG +endif + +ENDM + +ifndef ATSAME +; type 2 +IRP VKFLAG, <0, 1> + + klabels PatchAShCtlAlt3VK, PatchAShCtlAlt3, VKFLAG + +; (Same as XT) + + klabdef PatchAShCtlAlt3End, VKFLAG + +ENDM +endif + + +; type 2 +IRP VKFLAG, <0, 1> + + klabels PatchAShCtlAlt2VK, PatchAShCtlAlt2, VKFLAG + +; Patch Shift-Control-Alt table for type 2 + + klabdef PatchAShCtlAlt2End, VKFLAG + +ENDM + +ifdef NOKIA +; type 5 +IRP VKFLAG, <0, 1> + + klabels PatchAShCtlAlt5VK, PatchAShCtlAlt5, VKFLAG + +; Patch Shift-Control-Alt table for type 5 + ktrans VK_2 , '@', VKFLAG + ktrans VK_3 , '#', VKFLAG + ktrans VK_4 , '$', VKFLAG + ktrans VK_6 , '^', VKFLAG + ktrans VK_9 , '{', VKFLAG + ktrans VK_0 , '}', VKFLAG + ktrans VK_OEM_4 , '[', VKFLAG + ktrans VK_OEM_6 , ']', VKFLAG + ktrans VK_OEM_3 , 0ach, VKFLAG + ktrans VK_OEM_7 , '~', VKFLAG + ktrans VK_OEM_5 , '|', VKFLAG + + klabdef PatchAShCtlAlt5End, VKFLAG + +ENDM + +; type 6 +IRP VKFLAG, <0, 1> + + klabels PatchAShCtlAlt6VK, PatchAShCtlAlt6, VKFLAG + +; Patch Shift-Control-Alt table for type 6 + ktrans VK_2 , '@', VKFLAG + ktrans VK_3 , '#', VKFLAG + ktrans VK_4 , '$', VKFLAG + ktrans VK_6 , '^', VKFLAG + ktrans VK_9 , '{', VKFLAG + ktrans VK_0 , '}', VKFLAG + ktrans VK_OEM_4 , '[', VKFLAG + ktrans VK_OEM_6 , ']', VKFLAG + ktrans VK_OEM_3 , 0ach, VKFLAG + ktrans VK_OEM_7 , '~', VKFLAG + ktrans VK_OEM_5 , '|', VKFLAG + ktrans VK_OEM_COMMA, '<', VKFLAG + ktrans VK_OEM_PERIOD, '>', VKFLAG + + klabdef PatchAShCtlAlt6End, VKFLAG + +ENDM +endif + +; ******************************************************** +; +; Patches to 'Morto' (dead key table) +; +; Note: there are 2 size tables, since the key array +; contains words, and the translated array contains +; bytes. +; +; ******************************************************** + + public szPatchMortoVK + public PatchMortoVK + + public szPatchMortoCode + public PatchMortoCode + +szPatchMortoVK label word + dw CODEoffset PatchMortoEnd1 - CODEoffset PatchMorto1 + dw CODEoffset PatchMortoEnd2 - CODEoffset PatchMorto2 + dw CODEoffset PatchMortoEnd1 - CODEoffset PatchMorto1 + dw 0 +ifdef NOKIA + dw CODEoffset PatchMortoEnd5 - CODEoffset PatchMorto5 + dw CODEoffset PatchMortoEnd6 - CODEoffset PatchMorto6 +endif + +PatchMortoVK label word + dw CODEoffset PatchMorto1 + dw CODEoffset PatchMorto2 + dw CODEoffset PatchMorto1 + dw 0 +ifdef NOKIA + dw CODEoffset PatchMorto5 + dw CODEoffset PatchMorto6 +endif + +szPatchMortoCode label word + dw CODEoffset PatchMortoCodeEnd1 - CODEoffset PatchMortoCode1 + dw CODEoffset PatchMortoCodeEnd2 - CODEoffset PatchMortoCode2 + dw CODEoffset PatchMortoCodeEnd3 - CODEoffset PatchMortoCode3 + dw 0 +ifdef NOKIA + dw CODEoffset PatchMortoCodeEnd5 - CODEoffset PatchMortoCode5 + dw CODEoffset PatchMortoCodeEnd6 - CODEoffset PatchMortoCode6 +endif + +PatchMortoCode label word + dw CODEoffset PatchMortoCode1 + dw CODEoffset PatchMortoCode2 + dw CODEoffset PatchMortoCode1 + dw 0 +ifdef NOKIA + dw CODEoffset PatchMortoCode5 + dw CODEoffset PatchMortoCode6 +endif + +IRP VKFLAG, <0, 1> + + klabels PatchMorto1, PatchMortoCode1, VKFLAG +ifdef ATSAME + klabels PatchMorto3, PatchMortoCode3, VKFLAG +endif + + + klabels PatchMortoEnd1, PatchMortoCodeEnd1, VKFLAG +ifdef ATSAME + klabels PatchMortoEnd3, PatchMortoCodeEnd3, VKFLAG +endif + +ENDM + +ifndef ATSAME +IRP VKFLAG, <0, 1> + + klabels PatchMorto3, PatchMortoCode3, VKFLAG + +; (Same as XT) + + klabels PatchMortoEnd3, PatchMortoCodeEnd3, VKFLAG + +ENDM +endif + + +IRP VKFLAG, <0, 1> + + klabels PatchMorto2, PatchMortoCode2, VKFLAG + + + klabels PatchMortoEnd2, PatchMortoCodeEnd2, VKFLAG + +ENDM + +ifdef NOKIA +IRP VKFLAG, <0, 1> + + klabels PatchMorto5, PatchMortoCode5, VKFLAG + + + klabels PatchMortoEnd5, PatchMortoCodeEnd5, VKFLAG + +ENDM + +IRP VKFLAG, <0, 1> + + klabels PatchMorto6, PatchMortoCode6, VKFLAG + + + + klabels PatchMortoEnd6, PatchMortoCodeEnd6, VKFLAG + +ENDM +endif + +; ******************************************************** +; +; Patches to 'CapitalTable' +; +; ******************************************************** + + public szPatchCapital + public PatchCapital + +szPatchCapital label word + dw CODEoffset PatchCapEnd1 - CODEoffset PatchCap1 + dw CODEoffset PatchCapEnd2 - CODEoffset PatchCap2 + dw CODEoffset PatchCapEnd3 - CODEoffset PatchCap3 + dw 0 +ifdef NOKIA + dw CODEoffset PatchCapEnd5 - CODEoffset PatchCap5 + dw CODEoffset PatchCapEnd6 - CODEoffset PatchCap6 +endif + +PatchCapital label word + dw CODEoffset PatchCap1 + dw CODEoffset PatchCap2 + dw CODEoffset PatchCap1 + dw 0 +ifdef NOKIA + dw CODEoffset PatchCap5 + dw CODEoffset PatchCap6 +endif + +PatchCap1 label byte +ifdef ATSAME +PatchCap3 label byte +endif +; Capital table, type 1 +PatchCapEnd1 label byte +ifdef ATSAME +PatchCapEnd3 label byte + +else +PatchCap3 label byte +; (Same as XT) +PatchCapEnd3 label byte +endif + +PatchCap2 label byte +; Capital table, type 2 +PatchCapEnd2 label byte + +ifdef NOKIA +PatchCap5 label byte +; Capital table, type 5 +PatchCapEnd5 label byte + +PatchCap6 label byte +; Capital table, type 6 +PatchCapEnd6 label byte +endif + + +sEnd CODE + +; ******************************************************** +; +; Data segment -- this is FIXED +; +; ******************************************************** + +sBegin DATA + +; ******************************************************** +; +; This string identifies the table type (nationality). +; +; It is zero-terminated. +; +; ******************************************************** + + +public CountryName +CountryName label byte + + db ' USA ' + db 0 + +; ******************************************************** +; +; AscTranVK is an array of virtual keycodes, used as keys to +; search the WORD array AscTran for pairs of bytes (unshifted +; and shifted ASCII). +; +; ******************************************************** + + public PatchATran4 + +IRP VKFLAG, <0, 1> + + klabels AscTranVK, AscTran, VKFLAG + + ; This group is common to all keyboards. + ktrans2 VK_SPACE , ' ', ' ', VKFLAG + ktrans2 VK_TAB , 09h, 09h, VKFLAG + ktrans2 VK_RETURN , 0dh, 0dh, VKFLAG + ktrans2 VK_BACK , 08h, 08h, VKFLAG + ktrans2 VK_ESCAPE , 01bh, 01bh, VKFLAG + ktrans2 VK_CANCEL , 03h, 03h, VKFLAG + + ; Variable keys. These are: + ; VK_0..VK_9, VK_OEM_COMMA, VK_OEM_PERIOD VK_OEM_MINUS, VK_OEM_PLUS, + ; VK_OEM_1..VK_OEM_8, VK_OEM_102, and VK_DECIMAL + + klabels PatchATranVK, PatchATran4, VKFLAG + +; Variable entries in AscTab[]: + ktrans2 VK_0 , '0', ')', VKFLAG + ktrans2 VK_1 , '1', '!', VKFLAG + ktrans2 VK_2 , '2', '@', VKFLAG + ktrans2 VK_3 , '3', '#', VKFLAG + ktrans2 VK_4 , '4', '$', VKFLAG + ktrans2 VK_5 , '5', '%', VKFLAG + ktrans2 VK_6 , '6', '^', VKFLAG + ktrans2 VK_7 , '7', '&', VKFLAG + ktrans2 VK_8 , '8', '*', VKFLAG + ktrans2 VK_9 , '9', '(', VKFLAG + ktrans2 VK_OEM_COMMA, ',', '<', VKFLAG + ktrans2 VK_OEM_PERIOD, '.', '>', VKFLAG + ktrans2 VK_OEM_MINUS, '-', '_', VKFLAG + ktrans2 VK_OEM_PLUS , '=', '+', VKFLAG + ktrans2 VK_OEM_1 , ';', ':', VKFLAG + ktrans2 VK_OEM_2 , '/', '?', VKFLAG + ktrans2 VK_OEM_3 , '`', '~', VKFLAG + ktrans2 VK_OEM_4 , '[', '{', VKFLAG + ktrans2 VK_OEM_5 , '\', '|', VKFLAG + ktrans2 VK_OEM_6 , ']', '}', VKFLAG + ktrans2 VK_OEM_7 , 027h, '"', VKFLAG + ktrans2 VK_OEM_8 , -1, -1, VKFLAG + ktrans2 VK_OEM_102, '\', '|', VKFLAG + ktrans2 VK_DECIMAL, '.', '.', VKFLAG + + + ; The keypad translations MUST be AFTER the VK_OEM_*, + ; to make VkKeyScan() work properly! + ; VK_DECIMAL is first, since it sometimes (Danish, Finnish/Swedish, + ; German) translates to comma. + + ktrans2 VK_MULTIPLY, '*', '*', VKFLAG + ktrans2 VK_SUBTRACT, '-', '-', VKFLAG + ktrans2 VK_ADD , '+', '+', VKFLAG + ktrans2 VK_DIVIDE , '/', '/', VKFLAG + + klabdef AscTranEnd, VKFLAG + +ENDM + + + +; ******************************************************** +; +; This table associates a combination of ASCII code and accent +; with an ANSI accented character. +; +; There is a section below for each dead key, in an IFDEF. +; This table will be the same for all keyboards, for a particular +; DLL, even if some keyboards for a country have fewer dead keys +; than others. +; +; ******************************************************** + + +IRP VKFLAG, <0, 1> + + klabels DeadKeyCode, DeadChar, VKFLAG + + ; grave + ifdef DGRAVE + deadtrans 'a', grave, 0E0h, VKFLAG + deadtrans 'e', grave, 0E8h, VKFLAG + deadtrans 'i', grave, 0ECh, VKFLAG + deadtrans 'o', grave, 0F2h, VKFLAG + deadtrans 'u', grave, 0F9h, VKFLAG + deadtrans 'A', grave, 0C0h, VKFLAG + deadtrans 'E', grave, 0C8h, VKFLAG + deadtrans 'I', grave, 0CCh, VKFLAG + deadtrans 'O', grave, 0D2h, VKFLAG + deadtrans 'U', grave, 0D9h, VKFLAG + deadtrans ' ', grave, 060h, VKFLAG + endif + + ; acute + ifdef DACUTE + + deadtrans 'a', acute, 0E1h, VKFLAG + deadtrans 'e', acute, 0E9h, VKFLAG + deadtrans 'i', acute, 0EDh, VKFLAG + deadtrans 'o', acute, 0F3h, VKFLAG + deadtrans 'u', acute, 0FAh, VKFLAG + deadtrans 'y', acute, 0FDh, VKFLAG + deadtrans 'A', acute, 0C1h, VKFLAG + deadtrans 'E', acute, 0C9h, VKFLAG + deadtrans 'I', acute, 0CDh, VKFLAG + deadtrans 'O', acute, 0D3h, VKFLAG + deadtrans 'U', acute, 0DAh, VKFLAG + deadtrans ' ', acute, 0B4h, VKFLAG + endif + + ; circumflex + ifdef DCIRCUMFLEX + deadtrans 'a', circumflex, 0E2h, VKFLAG + deadtrans 'e', circumflex, 0EAh, VKFLAG + deadtrans 'i', circumflex, 0EEh, VKFLAG + deadtrans 'o', circumflex, 0F4h, VKFLAG + deadtrans 'u', circumflex, 0FBh, VKFLAG + deadtrans 'A', circumflex, 0C2h, VKFLAG + deadtrans 'E', circumflex, 0CAh, VKFLAG + deadtrans 'I', circumflex, 0CEh, VKFLAG + deadtrans 'O', circumflex, 0D4h, VKFLAG + deadtrans 'U', circumflex, 0DBh, VKFLAG + deadtrans ' ', circumflex, '^', VKFLAG + endif + + ; umlaut + ifdef DUMLAUT + deadtrans 'a', umlaut, 0E4h, VKFLAG + deadtrans 'e', umlaut, 0EBh, VKFLAG + deadtrans 'i', umlaut, 0EFh, VKFLAG + deadtrans 'o', umlaut, 0F6h, VKFLAG + deadtrans 'u', umlaut, 0FCh, VKFLAG + deadtrans 'y', umlaut, 0FFh, VKFLAG + deadtrans 'A', umlaut, 0C4h, VKFLAG + deadtrans 'E', umlaut, 0CBh, VKFLAG + deadtrans 'I', umlaut, 0CFh, VKFLAG + deadtrans 'O', umlaut, 0D6h, VKFLAG + deadtrans 'U', umlaut, 0DCh, VKFLAG + deadtrans ' ', umlaut, umlaut, VKFLAG + endif + + ; tilde + ifdef DTILDE + deadtrans 'a', tilde, 0e3h, VKFLAG + deadtrans 'o', tilde, 0f5h, VKFLAG + deadtrans 'n', tilde, 0F1h, VKFLAG + deadtrans 'A', tilde, 0c3h, VKFLAG + deadtrans 'O', tilde, 0d5h, VKFLAG + deadtrans 'N', tilde, 0D1h, VKFLAG + deadtrans ' ', tilde, '~' , VKFLAG + endif + + ; cedilla + ifdef DCEDILLA + deadtrans 'c', cedilla, 231, VKFLAG + deadtrans 'C', cedilla, 199, VKFLAG + endif + + klabdef DeadKeyEnd, VKFLAG + +ENDM + + +; ******************************************************** +; +; This table lists the virtual scancodes of the dead keys. +; Each entry lists the scan code and a shift state for which +; this key is a dead key, and the translated dead key. +; +; +; ******************************************************** + + public Morto, MortoCode + +IRP VKFLAG, <0, 1> + + klabels Morto, MortoCode, VKFLAG + + + klabdef MortoEnd, VKFLAG + + ; No Padding Needed + +ENDM + + +; ******************************************************** +; +; translations for control characters. +; +; ******************************************************** + + public VarAscCtrlVK, VarAscCtrl + +IRP VKFLAG, <0, 1> + + klabels AscControlVK, AscControl, VKFLAG + + ; this part is FIXED + + ktrans VK_CANCEL , 03h, VKFLAG + ktrans VK_BACK , 07fh, VKFLAG + ktrans VK_RETURN , 0ah, VKFLAG + ktrans VK_ESCAPE , 01bh, VKFLAG + ktrans VK_SPACE , 020h, VKFLAG +;; ktrans VK_EXECUTE, 0ah, VKFLAG + + ; starting here, these tables may be variable. + + klabels VarAscCtrlVK, VarAscCtrl, VKFLAG + + ktrans VK_2 , 080h, VKFLAG + ktrans VK_6 , 09eh, VKFLAG + ktrans VK_OEM_4 , 01bh, VKFLAG + ktrans VK_OEM_5 , 01ch, VKFLAG + ktrans VK_OEM_6 , 01dh, VKFLAG + ktrans VK_OEM_MINUS, 09fh, VKFLAG + ktrans VK_OEM_102, 01ch, VKFLAG + + klabdef AscControlEnd, VKFLAG + + ; No Padding Needed + +ENDM + + +; ******************************************************** +; +; These list translations for keys with CTRL-ALT and SHIFT-CTRL-ALT. +; +; ******************************************************** + + public AscCtlAltVK, AscCtlAlt + +IRP VKFLAG, <0, 1> + + klabels AscCtlAltVK, AscCtlAlt, VKFLAG + +; Control-Alt insertions for type 4 + ktrans VK_1 , 0b9h, VKFLAG + ktrans VK_2 , 0b2h, VKFLAG + ktrans VK_3 , 0b3h, VKFLAG + ktrans VK_4 , 0eah, VKFLAG + ktrans VK_5 , 080h, VKFLAG + ktrans VK_6 , 088h, VKFLAG + +; Should be y+circonflex, but it's not in CP1252. +; Replacing with y+acute, which isn't in qwerty-fr + ktrans VK_7 , 0fdh, VKFLAG + ktrans VK_8 , 0fbh, VKFLAG + ktrans VK_9 , 0eeh, VKFLAG + ktrans VK_0 , 0f4h, VKFLAG + + ktrans VK_Q , 0e2h, VKFLAG + ktrans VK_W , 0e9h, VKFLAG + ktrans VK_E , 0e8h, VKFLAG + ktrans VK_R , 0aeh, VKFLAG + +; Should be 'pi' but it's not in CP1252 +; ktrans VK_T , 0e9h, VKFLAG + + ktrans VK_Y , 0a5h, VKFLAG + ktrans VK_U , 0f9h, VKFLAG + ktrans VK_I , 0ech, VKFLAG + ktrans VK_O , 0f2h, VKFLAG + ktrans VK_P , 09ch, VKFLAG + + ktrans VK_A , 0e0h, VKFLAG + ktrans VK_S , 0e6h, VKFLAG + ktrans VK_D , 0ebh, VKFLAG + +; Should be epsilon, but it's not in CP1252 +; ktrans VK_F , 0e9h, VKFLAG + +; Should be alpha, but it's not in CP1252 +; ktrans VK_G , 0e9h, VKFLAG + ktrans VK_H , 0ffh, VKFLAG + ktrans VK_J , 0fch, VKFLAG + ktrans VK_K , 0efh, VKFLAG + ktrans VK_L , 0f6h, VKFLAG + + ktrans VK_Z , 0e4h, VKFLAG + ktrans VK_X , 0d7h, VKFLAG + ktrans VK_C , 0e7h, VKFLAG + +; Should be omega, but... +; ktrans VK_V , 0e9h, VKFLAG + + ktrans VK_B , 0dfh, VKFLAG + ktrans VK_N , 0f1h, VKFLAG + ktrans VK_M , 0b5h, VKFLAG + +; - + ktrans 0bdh , 096h, VKFLAG +; should be barred =, but that's not in CP1252 +; mapping the shift variant + ktrans 0bbh , 0b1h, VKFLAG + + ktrans 0dbh , 0abh, VKFLAG + ktrans 0ddh , 0bbh, VKFLAG + + ktrans 0bah , 0b6h, VKFLAG +; french apostrophe + ktrans 0deh , 0b4h, VKFLAG + ktrans 0bch , 0b8h, VKFLAG + ktrans 0dch , 0a6h, VKFLAG + + ktrans 0beh , 0b0h, VKFLAG +; Nearest approximation + ktrans 0bfh , 0bfh, VKFLAG + + + + klabdef AscCtlAltEnd, VKFLAG + + ; Padding + ktrans 000h, 00h, VKFLAG + +ENDM + + +; ******************************************************** +; +; Shift-Control-Alt +; +; ******************************************************** + + public AscShCtlAltVK, AscShCtlAlt + +IRP VKFLAG, <0, 1> + + klabels AscShCtlAltVK, AscShCtlAlt, VKFLAG + +; Shift-Ctrl-Alt insertions for type 4 + ktrans VK_1 , 0a1h, VKFLAG + +; Should be double acute, but it's not in CP1252 +; ktrans VK_2 , 0a1h, VKFLAG + + ktrans VK_3 , 0afh, VKFLAG + ktrans VK_4 , 0cah, VKFLAG + ktrans VK_5 , 0a3h, VKFLAG + +; Should be caron, but it's not in CP1252 +; ktrans VK_6 , 0a1h, VKFLAG + + ktrans VK_7 , 0ddh, VKFLAG + ktrans VK_8 , 0dbh, VKFLAG + ktrans VK_9 , 0ceh, VKFLAG + ktrans VK_0 , 0d4h, VKFLAG + + ktrans VK_Q , 0c2h, VKFLAG + ktrans VK_W , 0c9h, VKFLAG + ktrans VK_E , 0c8h, VKFLAG + ktrans VK_R , 0a9h, VKFLAG + +; Should capital pi, but it's not in CP1252 +; ktrans VK_T , 0h00, VKFLAG + + ktrans VK_Y , 0a4h, VKFLAG + ktrans VK_U , 0d9h, VKFLAG + ktrans VK_I , 0cch, VKFLAG + ktrans VK_O , 0d2h, VKFLAG + ktrans VK_P , 08ch, VKFLAG + + ktrans VK_A , 0c0h, VKFLAG + ktrans VK_S , 0c6h, VKFLAG + ktrans VK_D , 0cbh, VKFLAG + +; Should be delta, but that's not in CP1252 +; ktrans VK_F , 08ch, VKFLAG + +; Should be beta, but that's not in CP1252 +; ktrans VK_G , 08ch, VKFLAG + + ktrans VK_H , 09fh, VKFLAG + ktrans VK_J , 0dch, VKFLAG + ktrans VK_K , 0cfh, VKFLAG + ktrans VK_L , 0d6h, VKFLAG + + ktrans VK_Z , 0c4h, VKFLAG + ktrans VK_X , 0f7h, VKFLAG + ktrans VK_C , 0c7h, VKFLAG + +; Should be capital omega but it's not in CP1252 +; ktrans VK_V , 0d6h, VKFLAG + + ktrans VK_B , 0feh, VKFLAG + ktrans VK_N , 0d1h, VKFLAG + +; Should be sigma but it's not in CP1252 +; ktrans VK_M , 0d6h, VKFLAG + +; - + ktrans 0bdh , 097h, VKFLAG +; same as non-shift mapping + ktrans 0bbh , 0b1h, VKFLAG + + ktrans 0dbh , 093h, VKFLAG + ktrans 0ddh , 094h, VKFLAG + + ktrans 0bah , 0a7h, VKFLAG +; french apostrophe + ktrans 0deh , 0a8h, VKFLAG + +; 'ogonek' (reverse cedilla) doesn't exists in CP1252 +; Replacing with '...' + ktrans 0bch , 085h, VKFLAG + ktrans 0dch , 0f8h, VKFLAG + + ktrans 0beh , 0b7h, VKFLAG +; Same as the non-shift variant + ktrans 0bfh , 0bfh, VKFLAG + + klabdef AscShCtlAltEnd, VKFLAG + + + ; Padding + ktrans 000h, 00h, VKFLAG + ktrans 000h, 00h, VKFLAG + ktrans 000h, 00h, VKFLAG + ktrans 000h, 00h, VKFLAG + ktrans 000h, 00h, VKFLAG + ktrans 000h, 00h, VKFLAG + ktrans 000h, 00h, VKFLAG + ktrans 000h, 00h, VKFLAG + ktrans 000h, 00h, VKFLAG + ktrans 000h, 00h, VKFLAG + ktrans 000h, 00h, VKFLAG + ktrans 000h, 00h, VKFLAG + ktrans 000h, 00h, VKFLAG + +ENDM + + +; ******************************************************** +; +; This table lists the virtual keycodes of keys with caps lock +; or shift lock, other than letters VK_A..VK_Z. +; +; ******************************************************** + + public CapitalTable + +CapitalTable label byte + + ; db VK_code + +; Capital table, type 4 + +CapitalEnd label byte + + ; No Padding Needed + + + +; ******************************************************** +; +; This table handles shiftlock translation on the Swiss-German +; keyboard only. +; +; ******************************************************** + + +IRP VKFLAG, <0, 1> + + klabels SGCapsVK, SGTrans, VKFLAG + +ifdef SGCAPS + ktrans VK_OEM_1, 0dch, VKFLAG ; U umlaut + ktrans VK_OEM_7, 0d6h, VKFLAG ; O umlaut + ktrans VK_OEM_5, 0c4h, VKFLAG ; A umlaut +endif + + klabdef SGCapsEnd, VKFLAG + +ENDM + +KeyEnd label byte + + +sEnd DATA + + if2 + %out .. end KBDUS.ASM + %out + endif + +end + +; diff --git a/KBDQWFR.DEF b/KBDQWFR.DEF new file mode 100644 index 0000000..5422902 --- /dev/null +++ b/KBDQWFR.DEF @@ -0,0 +1,20 @@ +; This is a DynaLink Library containing keyboard driver tables. +LIBRARY KBDUS + +EXETYPE WINDOWS + +DESCRIPTION 'KeyTable QWERTY-FR' + +; (No stub file) + +; The code segment contains patch tables and once-only code. +CODE LOADONCALL DISCARDABLE + +; The data segment remains loaded until the keyboard driver unloads the DLL. +DATA PRELOAD FIXED SINGLE + +EXPORTS + GetKbdTable @1 +; GetKeyString @2 -- not defined. Use English name table in driver + + WEP diff --git a/KBDQWFR.DLL b/KBDQWFR.DLL new file mode 100644 index 0000000000000000000000000000000000000000..0c62680d17e0ba87d3f8406c12caae8758bb7878 GIT binary patch literal 2184 zcmb_e3vd%f82;~eThh{2V8B62+iQi=2Mw2`ukcPT7aDp=Lmmy!mI46^p@lRBfwnSJ zWPn3NbYR9|C}>ecbZ>b@`Ai?K=TP%wZn zu@WhU61YR$w9J%N^oG8~ibR8=;IsoE7jGrAk*$U2^EL}F z&_Q%!6!khtIEjK@`R>Jzl4%|{GtR}^91}8(Hh}J9cn67h==1_FCFOr;jMJ`TfQg7! z#3ELu)?{X7=j3V+wzf1kwfO_*+b>+~D4R2HZaKq5L_|j`6tS@gv8k#=^=QqDnFF#0 zW*6lo=cZ{>1`k(`%qSj_K5XcaQB!LsEuCC7rFu|OFgUqNsZ2}D$Vg8gG6X52V;OZe znYE<@y&M_KEZZF0Kd!F-qh(oXuM?c60;|q$$Qzq4OdQYYE#{WyKzq}LgXde@;J`;8 zUtPBH&wD@r)^X*hUEA(n@7(m=57&bCZ``{4&5sv<{ba-551RMyYkYT48>q-$$X1>` z=Mz&tnZ&KTkH6C%ICJ|MrX1Yy6*nUU&Y>uaDe5`ry>Yy>Gnv-u74SG_*Y# z@-M%W=rlSL*3)m%3kbeVSHmItIK7N}H?6P-(U76X%#K_s&-`I**63 zN#iOQo4dm8UFe>ngf(Z^@lNr2{Mxg%*A<1X`|A~TS&cF zjUSYfnm$-MzJ;#wRn$7FimIntn#Z{&1ln~?7yRcZnh&Chv49mx5Cv&4=+PSv2M;WVa|Au4n)Or)yac-;h6>r86ixS%OInJ1+-P{(Mt`$e zkOV+YPovc&{=ZaLFsM|r#iSaO9#&&=&Y;{BZK_<2BZj3{U>>>6PQd{>@`R!}oz*TBaQR?Vfl&=c4Hz@Qm<7gcFy??U7mQlc#e%h@vce5^ z&Q>4@j2s{>ks~jZE2CCMyHhXgOc}Fe%$CtAkXu{|Qpu>6Q6nQOqk-p4W}QHmBUDs` zi;9p@5jHA9M@9Ik2q6_=q#~5mEO{i#WSp9eQ)fb++cO_HkGsSRdat`=E(~W$>07;J zKE^)XTLzZOd5lm#eXhJ%C}W}ANZH6MF!SIf-=#4G1fHZ&?jxBsfT6%;AswCdp+o2xI*HDp zc613{K{wFvh{9nw0!QPXxDS2-$Kgag5U1h{tioAXi$`Ju9*Ya`1UwCU@It&4*Wg;b z60gPU@kYEEZ^Jur18%{G@k#s@4&Y1p@oiV=5{*&n%g8UDRf-MYV{(NZsZnSGq9uIi fj!3_+8`p7L?Jw9N9!_|4$0#TWqk#PX_z?aA0ya_( literal 0 HcmV?d00001 diff --git a/KEYBOARD.INC b/KEYBOARD.INC new file mode 100644 index 0000000..d92dd03 --- /dev/null +++ b/KEYBOARD.INC @@ -0,0 +1,237 @@ +;*** KEYBOARD.INC ********************************************************** +; * +; Copyright (C) 1983,1984,1985,1986,1987,1988,1989,1990 by Microsoft Corp. * +; * +;*************************************************************************** +; +; History +; 21 nov 88 peterbe Removed the macros pin and pout +; 24 aug 89 peterbe Add fAltW, fCtrlW +; 27 dec 88 peterbe Remove defs for unused part of KBINFO +; 30 nov 88 davidw Add the macros pin and pout +; 22 sep 88 peterbe Added IBMPS280ID +; 16 aug 88 peterbe Added IDM240 +; 12 aug 88 peterbe Modified comment regarding AT&T. +; Added RAMBIOS segment definition. +; Added fCaps, etc. definitions. +; 09 aug 88 peterbe Removed 'kbSLTable' definition +; 08 aug 88 peterbe Removed 'kbX1X2Swap' definition +; 01 aug 88 peterbe Added 'kbX1X2Swap' definition +; 29 jul 88 peterbe Delete accent definitions. +; 18 jul 88 peterbe Windows 3.xx version +; +if1 +%out KEYBOARD.INC 3.00 +endif +;*************************************************************************** +; * +; Header file for IBM/PC keyboard device driver. Contains all machine * +; specific constant and data structure definitions. * +; * +;*************************************************************************** +include cmacros.inc +include windefs.inc + + +ack_port equ 20h ; 8259 acknowledge port +eoi equ 20h ; 8259 end of interrupt (Specific) +eoiAT equ 61h ; end of interrupt for AT-like system (for IRQ 1) + +timer_port equ 40h ; 8253 Counter Timer +kb_data equ 60h +kb_ctl equ 61h + +; hardware interrupt vector number +; +vector equ 09h + +;*************************************************************************** +; +; for writing to keyboard output port (Olivetti M24, etc.), need to check status +; +;*************************************************************************** + +kb_status equ 64h ; status port -- bit 1: ok to write + +;*************************************************************************** +; Definition of BIOS RAM data area +;*************************************************************************** + +RAMBIOS SEGMENT AT 40H + +ifdef NOKIA + org 16h +ProtocolFlag label byte +endif ; NOKIA + + org 17h +kb_flag label byte + org 18h +kb_flag_1 label byte + org 1ah +buffer_head label word + org 1ch +buffer_tail label word + org 1eh +kb_buffer label word + + org 49h +CrtMode label byte ; bios data area for screen mode + + org 72h +fReset label byte ; bios area for reset flags + + org 96h +KB_type label BYTE ; contains RT keyboard identification + +ifdef NOKIA + ORG 0EEH +KeyBoardId LABEL BYTE +endif ; NOKIA + +RAMBIOS ENDS + + + +;*************************************************************************** +; bits in kb_flag and kb_flag_1 +;*************************************************************************** + + +; Flag bits in kb_flag + +fCaps equ 01000000b ; caps (or shift-) lock +fNum equ 00100000b ; numlock +fScroll equ 00010000b ; scroll lock +fAlt equ 00001000b ; ALT key +fCtrl equ 00000100b ; Control key +fLshift equ 00000010b ; left shift key +fRshift equ 00000001b ; right shift key +fShift equ fLshift+fRshift ; either or both shift keys + +; Flag bits in the word at kb_flag (kb_flag and kb_flag_1) +; (need to set/reset BOTH for Alt and Ctrl keys) + +fAltW equ 1000001000b ; ALT key +fCtrlW equ 0100000100b ; Control key + +; Flag bits in kb_flag_1 +fHold equ 00001000b ; Pause + + +ifdef NOKIA + +; Values of Nokia keyboard ID byte. +ID_IBM EQU 0AAH +ID1050 EQU 0A5H +ID1051 EQU 0A8H +ID9140 EQU 0A6H + +; bit in ProtocolFlag +$PrefixFlag EQU 00000100B +endif + + +;*************************************************************************** +; Olivetti/AT&T keyboard identifiers in the OliType byte. Valid only +; for Olivetti-protocol keyboards. This byte is 0 for others. +; This is used in the 3.00 driver only as a flag (in WIN.INI) for +; Olivetti/AT&T keyboard type. Only the first 3 types are used +; on 8086 systems. The KB302 has an extra LED. +;*************************************************************************** + +KB83 equ 2 ; M24 83-key keyboard +KB302 equ 4 ; AT&T 6300 PLUS (HAS EXTRA LED TO HANDLE) +KB102 equ 1 ; M24 102-key keyboard (84-key XT) + ; +KB86 equ 10h ; M28 keyboard with SYSREQ key +KBM28 equ 10h ; .. same thing +KB102RT equ 40h ; 101-102 extended keyboard (RONCO)(RT) +KBXT83 equ 42h ; XT 83 key keyboard on M28 + + +;*************************************************************************** +; .. and special bit values in KeyType for the RT (101/102) keyboard. +;*************************************************************************** + +kbShiftLock equ 40h ; set if Shiftlock instead of caps lock +kbAltGr equ 08h ; AltGr = CTRL-ALT -- all but USA + + +;*************************************************************************** +; System ID byte or word values (AT F000:FFFE) +;*************************************************************************** + +; Olivetti systems, ID = 0 + +M24ID equ 0 ; PC 1050 (M24), M24SP, AT&T 6300 +M24ID_2 equ 41h + +; Olivetti systems, ID = FF + +M22ID equ 0FFh ; 1020 (but don't worry about this). + ; 2nd byte probably not FF +M15ID equ 0FFh +M15ID_2 equ 046h + +; Olivetti systems, ID = FE + +M19ID equ 0FEh ; PC 1030 + ; 2nd byte is NOT FF + +; Olivetti systems, ID = FC + +M28ID equ 0FCh ; PC 1076 +M28ID_2 equ 42H ; 1.10 2nd byte +M28ID_2_old equ 0 ; 1.08 2nd byte + +ID1041 equ 0FCh +ID1041_2 equ 044h + +ID1078 equ 0FCh +ID1078_2 equ 042h + +ID1338 equ 0FCh +ID1338_2 equ 048h + +ID6300P equ 0FCh ; AT&T 6300 plus +ID6300P_2 equ 0 ; same as IBM AT! + +; Olivetti systems, ID = FB + +ID1040 equ 0FBh ; +ID1040_2 equ 43h + +ID1336 equ 0FBh ; +ID1336_2 equ 47h + +IDM240 equ 0FBh ; +IDM240_2 equ 0B5h + +; IBM systems + +IBMPCID equ 0FFh ; IBM PC, and M22/1020 +IBMPCID_2 equ 0FFh ; IBM PC, NOT M22 + +IBMXTID equ 0FEh ; IBM PC XT, and M19/1030 +IBMPCID_2 equ 0FFh ; IBM PC, NOT 1030 + +IBMATID equ 0FCh ; IBM PC AT, and Oli. M28, etc. +IBMATID_2 equ 0 ; IBM PC AT + +; PS/2 Model 30 FA 00 +; PS/2 Model 35 FA AF +; PS/2 Model 50 FC 04 +; PS/2 Model 60 FC 05 +; PS/2 Model 80 F8 00 + +IBMPS2ID equ 0FAh ; IBM PS/2 mod 30, 35 + ; mods 50, 60 have AT ID! +IBMPS280ID equ 0F8h ; IBM PS/2 mod 80 + +;*************************************************************************** +; macros for allowing the virtualization of I/O in protect mode Windows +;*************************************************************************** + +; extrn __VIRTUALIZE_IO :abs + extrn __ROMBIOS :abs diff --git a/MAKEFILE b/MAKEFILE new file mode 100644 index 0000000..6cfc6cd --- /dev/null +++ b/MAKEFILE @@ -0,0 +1,58 @@ +# Qwerty-fr CP1252 Variant Makefile +# Target: KBDQWFR.DLL +# Based from KEYBOARD TABLES Makesfile from WIN3.1 DDK + +DLL1 = kbdqwfr.dll + +target: $(DLL1) + +# make keyboard table DLL's. + +######## main routine for patching tables and copying stuff to driver ##### + +# All but US version -- X1/X2 swap for AT keyboard. + +getkbd.obj: getkbd.asm date.inc + masm -DX1X2 getkbd; + +######## individual table files. ######## + +# each one contains tables for several keyboards for one nationality. + +INCS=trans.inc keyboard.inc vkoem.inc vkwin.inc +ASM=masm -I.\ + +# Qwerty-fr +kbdqwfr.obj: kbdqwfr.asm $(INCS) + $(ASM) kbdqwfr; + + +########### Assemble the key-name tables, for various DLL's ############# +# Not all DLL's have a GetKeyString() function. + +# US/UK: English +namesus.obj: names.asm namesus.inc trans.inc + command /c copy namesus.inc names.inc + $(ASM) names, namesus; + command /c del names.inc + + +########### Link all the DLL's ############# + +# Link qwerty-fr DLL + +kbdqwfr.dll: kbdqwfr.def getkbd.obj kbdqwfr.obj namesus.obj + link getkbd kbdqwfr namesus, kbdqwfr.exe/align:16,kbdqwfr/map, \ + sdllcew libw /NOD,kbdqwfr.def + rc kbdqwfr.exe + mapsym kbdqwfr + command /c copy kbdqwfr.exe kbdqwfr.dll + command /c del kbdqwfr.exe + +clean: + del kbdqwfr.obj + del kbdqwfr.sym + del kbdqwfr.map + del getkbd.obj + del namesus.obj + del kbdqwfr.dll diff --git a/NAMES.ASM b/NAMES.ASM new file mode 100644 index 0000000..80733aa --- /dev/null +++ b/NAMES.ASM @@ -0,0 +1,91 @@ + page ,132 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; NAMES.asm +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright (C) 1989-1990 Microsoft Corporation. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; This contains the GetKeyString function for the keyboard DLL. +; +; int FAR PASCAL GetKeyString(int nString, LPSTR lpStringOut); +; +; nString index to list of strings +; +; lpStringOut selected string is copied to this address +; +; The size of the string (exclusive of NULL termination) is +; returned in AX. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +include cmacros.inc +include trans.inc + +sBegin DATA + +sEnd DATA + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Macro for defining StringTab: + +stab macro ?FLAG, l, n, s + IF ?FLAG EQ 0 + n = temp + temp = temp + 1 + l db s ; string + db 0 ; 0-terminate + ELSE + dw NAMESoffset l + ENDIF +endm + +createSeg _NAMES, NAMES, BYTE, PUBLIC, CODE +sBegin NAMES ; Beginning of code segment +assumes CS,NAMES +assumes DS,DATA + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +include names.inc ; one of NAMES??.INC +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +cProc GetKeyString,, + + parmW nString ; index to StringTab[] + parmD lpStringOut ; copy string to this address + parmW iSize ; max. size + +cBegin + + mov ax,nString ; get string index. + xor ah,ah ; change [AL] to word index.. + add ax,ax + mov bx,ax + mov si, cs:[StringTab + bx] ; get offset of string from table. + push ds ; save DS, + push cs ; make DS = CS + pop ds ; DS:SI -> string + les di, lpStringOut ; ES:DI -> destination string + xor bx,bx ; clear byte count + mov cx,iSize ; get max string size +CopyLoop: + lodsb ; get a byte + stosb ; store it + or al,al ; was it null byte? + jz CopyDone ; if so, we're done .. almost .. + inc bx ; if not, increment byte count. + loop CopyLoop ; check max loop count & loop back. + xor al,al ; if we fall through, + dec di ; back up, and + stosb ; store a 0 byte + +CopyDone: + mov ax,bx ; return this byte count + pop ds ; restore DS + +cEnd + + +sEnd NAMES + +end diff --git a/NAMESUS.INC b/NAMESUS.INC new file mode 100644 index 0000000..242866c --- /dev/null +++ b/NAMESUS.INC @@ -0,0 +1,147 @@ + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; NameUS.INC -- Tables for GetKeyNameText() -- US/UK (English) +; +; Copyright 1989, 1990 by Microsoft Corporation. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; History (last first) +; 18 dec 89 peterbe Added degree sign for ring accent. +; 15 jul 89 peterbe Added additional function key support. + +; ANSI characters for accented letters +aAcl equ 225 ; a acute - lower-case +eAcl equ 233 ; e acute +iAcl equ 237 ; i acute +oAcl equ 243 ; o acute +uAcl equ 250 ; u acute + +aAcu equ 225 ; A acute - upper-case +eAcu equ 233 ; E acute +iAcu equ 237 ; I acute +oAcu equ 243 ; O acute +uAcu equ 250 ; U acute + +aGrl equ 224 ; a grave - lower-case +eGrl equ 232 ; e grave +iGrl equ 236 ; i grave +oGrl equ 242 ; o grave +uGrl equ 249 ; u grave + +; ... etc.... + +; If you put an accented character in a string, place the whole +; string in angle brackets: <"abc",accent,"def"> + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; StringTab[]: +; +; Table of key names. StringTab[] is an array of offsets to the strings, +; indiced by the numeric values nEsc, nBS, ... nDELETE, which are +; consecutive integers, defined by the macros used here. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + temp = 0 ; init. variable for defining indices. + +IRP flag, <0,1> + + if flag eq 1 + StringTab label word + endif + +; Strings -- normal. + + ; select label index string + + STAB flag, lESC, nEsc, "ESC" + STAB flag, lBS, nBS, "BACKSPACE" + STAB flag, lTAB, nTab, "TAB" + STAB flag, lENT, nEnter, "ENTER" + STAB flag, lCTRL, nCtrl, "CTRL" + STAB flag, lSH, nShift, "SHIFT" + ; left-hand '/' key has other translations on non-USA keyboards. + ; the Num Div key is actually an extended key.. + STAB flag, lND, nNumDiv, "NUM DIVIDE" + STAB flag, lRSh, nRShift, "RIGHT SHIFT" + STAB flag, lNM, nNumMult, "NUMMULT" + STAB flag, lAlt, nAlt, "ALT" + STAB flag, lSP, nSpace, "SPACE" + STAB flag, lCaps, nCapsLock, "CAPSLOCK" + STAB flag, lF1, nF1, "F1" + STAB flag, lF2, nF2, "F2" + STAB flag, lF3, nF3, "F3" + STAB flag, lF4, nF4, "F4" + STAB flag, lF5, nF5, "F5" + STAB flag, lF6 nF6, "F6" + STAB flag, lF7, nF7, "F7" + STAB flag, lF8, nF8, "F8" + STAB flag, lF9, nF9, "F9" + STAB flag, lF10, nF10, "F10" + STAB flag, lPause, nPause, "Pause" + STAB flag, lScr, nScroll, "SCROLL LOCK" + STAB flag, lNum7, nNum7, "NUM 7" + STAB flag, lNum8, nNum8, "NUM 8" + STAB flag, lNum9, nNum9, "NUM 9" + STAB flag, lNumSb, nNumSub, "NUM SUB" + STAB flag, lNum4, nNum4, "NUM 4" + STAB flag, lNum5, nNum5, "NUM 5" + STAB flag, lNum6, nNum6, "NUM 6" + STAB flag, lNumPl, nNumPlus, "NUM PLUS" + STAB flag, lNum1, nNum1, "NUM 1" + STAB flag, lNum2, nNum2, "NUM 2" + STAB flag, lNum3, nNum3, "NUM 3" + STAB flag, lNum0, nNum0, "NUM 0" + STAB flag, lNumDc, nNumDec, "NUM DECIMAL" + STAB flag, lF11, nF11, "F11" + STAB flag, lF12, nF12, "F12" + + STAB flag, lF13, nF13, "F13" ; ICO, NOKIA, others + STAB flag, lF14, nF14, "F14" + STAB flag, lF15, nF15, "F15" + STAB flag, lF16, nF16, "F16" + STAB flag, lF17, nF17, "F17" + STAB flag, lF18, nF18, "F18" + STAB flag, lF19, nF19, "F19" + STAB flag, lF20, nF20, "F20" + STAB flag, lF21, nF21, "F21" + STAB flag, lF22, nF22, "F22" + STAB flag, lF23, nF23, "F23" + STAB flag, lF24, nF24, "F24" + STAB flag, lhelp, nhelp, "Help" ; ICO (extend bit set) + STAB flag, lClear, nClear, "Clear" ; ICO (extend bit set) + STAB flag, lBreak, nBreak, "Break" ; ICO (extend bit set) + STAB flag, l00, n00 "<00>" ; ICO (extend bit is + ; set on second 0) + +; strings for extended keys. + STAB flag, lPrtS, nPrtScreen, "Prnt Scrn" + STAB flag, lNumL, nNumLock, "Num Lock" + STAB flag, lNumEn, nNumEnter, "NUM ENTER" + STAB flag, lAltGr, nAltGr, "RIGHT ALT" + STAB flag, lHome, nHome, "HOME" + STAB flag, lUP, nUP, "UP" + STAB flag, lPGUP, nPGUP, "PGUP" + STAB flag, lLEFT, nLEFT, "LEFT" + STAB flag, lRIGHT, nRIGHT, "RIGHT" + STAB flag, lEND, nEND, "END" + STAB flag, lDOWN, nDOWN, "DOWN" + STAB flag, lPGDN, nPGDOWN, "PGDOWN" + STAB flag, lINS, nINSERT, "INSERT" + STAB flag, lDEL, nDELETE, "DELETE" + STAB flag, lRCtrl, nRCtrl, "Right Ctrl" + + +; Strings for dead keys. +; NOTE: Translate these even if your keyboard doesn't have these dead keys! + + STAB flag, dACUTE, nACUTE, "ACUTE" + STAB flag, dGRAVE, nGRAVE, "GRAVE" + STAB flag, dCIRCU, nCIRCUMFLEX, "CIRCUMFLEX" + STAB flag, dUMLAU, nUMLAUT, "UMLAUT" + STAB flag, dTILDE, nTILDE, "TILDE" + STAB flag, dCED, nCEDILLA, "CEDILLA" + STAB flag, dRING, nRING 176 ; prob. Iceland only + +endm ; End of IRP diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..9e672aa --- /dev/null +++ b/README.MD @@ -0,0 +1,74 @@ +# QWERTY-FR for Windows 3.0/3.1 +## CP1252-Compatible variant. + +This is a Windows 3.x port of: http://marin.jb.free.fr/qwerty-fr/ + +There's a few differences, as some characters from the keytable aren't available in CP1252. + +Parts of this repository are from Win3.1 DDK and included to simplify the building process. + +Namely: + +``` +DATE.INC: Copyright (C) 1989-1990 by Microsoft Corporation. +KEYBOARD.INC: Copyright (C) 1983,1984,1985,1986,1987,1988,1989,1990 by Microsoft Corp. +NAMESUS.INC: Copyright 1989, 1990 by Microsoft Corporation. +TRANS.INC: Copyright (C) 1988,1989,1990 by Microsoft Corporation. +VKOEM.INC: Copyright (C) 1989,1990 by Microsoft Corp. +VKWIN.INC: Copyright (C) 1989,1990 by Microsoft Corp. +GETKBD.ASM: Copyright (C) 1989-1990 by Microsoft Corporation. +NAMES.ASM: Copyright (C) 1989-1990 by Microsoft Corporation. +``` + +`KBDQWFR.ASM` is based on `'KBDUS.ASM', Copyright (C) 1989-1990 Microsoft Corporation.` + +### Changed keybinds: +`altgr-7` is acute-y instead instead of circumflex. + +`altgr-=` is equivalent to altgr-shift-=, 'NOT EQUAL TO' isn't in CP1252. + +`altgr-/` is equivalent to altgr-shift-/, 'ARABIC QUESTION MARK' isn't in CP1252. + +`shift-altgr-,` is '...', 'OGONEK isn't in CP1252 and this one might useful. + +`shift-altgr-.` is 'MIDDLE DOT', might be useful (non-shifted variant already maps to 0xB0). + +### Removed keybinds: +`altgr-t`: 'pi' symbol isn't in CP1252. + +`altgr-f`: Epsilon/Delta aren't in CP1252. + +`altgr-g`: Alpha/Beta aren't in CP1252. + +`altgr-v`: Omega isn't in CP1252. + +`altgr->`, `altgr-<`: 'GREATER-THAN OR EQUAL TO' & 'LESS-THAN OR EQUAL TO' aren't in CP1252. + +### How to build +You should have [Win3.1 DDK](https://winworldpc.com/download/3d0639c3-9e18-c39a-11c3-a4e284a2c3a5) installed. + +Set PATH accordingly, eg: +``` +set PATH=%PATH%;C:\MSVC\BIN +set LIB=C:\DEV\DDK\286\LIB +set INCLUDE=C:\DEV\DDK\286\INC +``` + +Then run `nmake`. + +### How to install +* Copy `KBDQWFR.DLL` to `%windir%\SYSTEM\` +* Edit `%windir%\SYSTEM.INI`: + +In 'keyboard' section, add or replace the keyboard.dll line like this: + +`keyboard.dll=kbdqwfr.dll` + +A complete section should be like: +``` +[keyboard] +keyboard.dll=kbdqwfr.dll +subtype= +type=4 +oemansi.bin=xlat850.bin +``` diff --git a/README.TXT b/README.TXT new file mode 100644 index 0000000..9b6d2ba --- /dev/null +++ b/README.TXT @@ -0,0 +1,59 @@ +QWERTY-FR for Windows 3.0/3.1 +CP1252-Compatible variant. + +This is a Windows 3.x port of: +http://marin.jb.free.fr/qwerty-fr/ + +There's a few differences, as some characters from the keytable aren't available in CP1252. + +Parts of this repository are from Win3.1 DDK and included to simplify the building process. +Namely: +DATE.INC: Copyright (C) 1989-1990 by Microsoft Corporation. +KEYBOARD.INC: Copyright (C) 1983,1984,1985,1986,1987,1988,1989,1990 by Microsoft Corp. +NAMESUS.INC: Copyright 1989, 1990 by Microsoft Corporation. +TRANS.INC: Copyright (C) 1988,1989,1990 by Microsoft Corporation. +VKOEM.INC: Copyright (C) 1989,1990 by Microsoft Corp. +VKWIN.INC: Copyright (C) 1989,1990 by Microsoft Corp. +GETKBD.ASM: Copyright (C) 1989-1990 by Microsoft Corporation. +NAMES.ASM: Copyright (C) 1989-1990 by Microsoft Corporation. + +KBDQWFR.ASM is based on 'KBDUS.ASM', Copyright (C) 1989-1990 Microsoft Corporation. + +Changed keybinds: +altgr-7 is acute-y instead instead of circumflex +altgr-= is equivalent to altgr-shift-=, 'NOT EQUAL TO' isn't in CP1252 +altgr-/ is equivalent to altgr-shift-/, 'ARABIC QUESTION MARK' isn't in CP1252 +shift-altgr-, is '...', 'OGONEK isn't in CP1252 and this one might useful +shift-altgr-. is 'MIDDLE DOT', might be useful (non-shifted variant already maps to 0xB0) + +Removed keybinds: +altgr-t: 'pi' symbol isn't in CP1252. +altgr-f: Epsilon/Delta aren't in CP1252 +altgr-g: Alpha/Beta aren't in CP1252 +altgr-v: Omega isn't in CP1252 +altgr->, altgr-<: 'GREATER-THAN OR EQUAL TO' & 'LESS-THAN OR EQUAL TO' aren't in CP1252 + +* How to build +You should have Win3.1 DDK installed: +https://winworldpc.com/download/3d0639c3-9e18-c39a-11c3-a4e284a2c3a5 + +Set PATH accordingly, eg: +set PATH=%PATH%;C:\MSVC\BIN +set LIB=C:\DEV\DDK\286\LIB +set INCLUDE=C:\DEV\DDK\286\INC + +Then run 'nmake'. + +* How to install +- Copy KBDQWFR.DLL to %windir%\SYSTEM\ +- Edit %windir%\SYSTEM.INI: + +In 'keyboard' section, add or replace the keyboard.dll line like this: +keyboard.dll=kbdqwfr.dll + +A complete section should be like: +[keyboard] +keyboard.dll=kbdqwfr.dll +subtype= +type=4 +oemansi.bin=xlat850.bin diff --git a/TRANS.INC b/TRANS.INC new file mode 100644 index 0000000..bbbb4c2 --- /dev/null +++ b/TRANS.INC @@ -0,0 +1,67 @@ +; ======================================================================== +; TRANS.INC +; +; Copyright (C) 1988,1989,1990 by Microsoft Corporation. +; +; ======================================================================== +; definitions for 3.00 keyboard drivers. + +; macros for translation table entry. + +; This is used for tables in which a byte in one array is used as +; a search key for a byte in a second array. + +ktrans macro vk, asc, ?VKFLAG + if ?VKFLAG EQ 0 + db vk + else + db asc + endif +endm + +; This is used for tables in which a byte in one array is used as +; a search key for a pair of bytes in a second array (e. g. +; unshifted and shifted translations). + +ktrans2 macro vk, asc1, asc2, ?VKFLAG + if ?VKFLAG EQ 0 + db vk + else + db asc1 + db asc2 + endif +endm + +; This macro is for the dead key table, which associates an unaccented +; character and an accent deadkey with an accented ANSI character. + +deadtrans macro ch, accent, accTrans, ?VKFLAG + if ?VKFLAG EQ 0 + db ch + db accent + else + db accTrans + endif +endm + + +; This macro provides labels for both columns of an associative table. + +klabels macro lab1, lab2, ?VKFLAG + if ?VKFLAG EQ 0 + lab1 label byte + else + lab2 label byte + endif +endm + + +; This macro provides a label for the end of the key vector of +; an associative table. + +klabdef macro deflab, ?VKFLAG + if ?VKFLAG EQ 0 + deflab label byte + endif +endm + diff --git a/VKOEM.INC b/VKOEM.INC new file mode 100644 index 0000000..1dc3a01 --- /dev/null +++ b/VKOEM.INC @@ -0,0 +1,89 @@ +;;; VKOEM.INC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Copyright (C) 1989,1990 by Microsoft Corp. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; History +; +; 3.00 Windows: +; +; 15 jul 89 peterbe Added comments on F17, F18 +; 09 jun 89 peterbe Deleted VK_OEM_NUMBER +; 08 sep 88 peterbe Removed Ifdef NOKIA .. always valid now. +; Removed VK_OEM_ALT. Rearranged in +; numeric order. +; 14 aug 88 peterbe Changed 'ERICSSON' to 'NOKIA' + +if1 +%out . VKOEM.INC +endif +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; This group is mainly used by Nokia. +; Some ICO keyboards will generate VK_OEM_F17 and VK_OEM_F18 +; VK_OEM_F&x = 80h, 81h, 82h, 83h, 84h, 85h, 86h, 87h + + IRP x,<17,18,19,20,21,22,23,24> +VK_OEM_F&x = 80H + (x - 17) + ENDM + +; 88h..8Fh unassigned + +; VK_OEM_NUMBER = 090H ; NumLock: now VK_NUMLOCK, devined in VKWIN.INC +VK_OEM_SCROLL = 091H ; ScrollLock + +; 92h..B9h unassigned + +VK_OEM_1 = 0BAH ; ';:' for US +VK_OEM_PLUS = 0BBH ; '+' any country +VK_OEM_COMMA = 0BCH ; ',' any country +VK_OEM_MINUS = 0BDH ; '-' any country +VK_OEM_PERIOD = 0BEH ; '.' any country +VK_OEM_2 = 0BFH ; '/?' for US +VK_OEM_3 = 0C0H ; '`~' for US + +; C1h..DAh unassigned + +VK_OEM_4 = 0DBH ; '[{' for US +VK_OEM_5 = 0DCH ; '\|' for US +VK_OEM_6 = 0DDH ; ']}' for US +VK_OEM_7 = 0DEH ; ''"' for US +VK_OEM_8 = 0DFH + +; codes various extended or enhanced keyboards +VK_F17 = 0E0H ; F17 key on ICO, win 2.xx +VK_F18 = 0E1H ; F18 key on ICO, win 2.xx + +VK_OEM_102 = 0E2H ; "<>" or "\|" on RT 102-key kbd. + +VK_ICO_HELP = 0E3H ; Help key on ICO +VK_ICO_00 = 0E4H ; 00 key on ICO + +; E5h unassigned + +VK_ICO_CLEAR = 0E6H + +; E7h .. E8h unassigned + +; Nokia/Ericsson definitions + +VK_ERICSSON_BASE = 0E8H + +VK_OEM_RESET = VK_ERICSSON_BASE + 1 ; e9 +VK_OEM_JUMP = VK_ERICSSON_BASE + 2 ; ea +VK_OEM_PA1 = VK_ERICSSON_BASE + 3 ; eb +VK_OEM_PA2 = VK_ERICSSON_BASE + 4 ; ec +VK_OEM_PA3 = VK_ERICSSON_BASE + 5 ; ed +VK_OEM_WSCTRL = VK_ERICSSON_BASE + 6 ; ee +VK_OEM_CUSEL = VK_ERICSSON_BASE + 7 ; ef +VK_OEM_ATTN = VK_ERICSSON_BASE + 8 ; f0 +VK_OEM_FINNISH = VK_ERICSSON_BASE + 9 ; f1 +VK_OEM_COPY = VK_ERICSSON_BASE + 10 ; f2 +VK_OEM_AUTO = VK_ERICSSON_BASE + 11 ; f3 +VK_OEM_ENLW = VK_ERICSSON_BASE + 12 ; f4 +VK_OEM_BACKTAB = VK_ERICSSON_BASE + 13 ; f5 + + +; F6h..FEh unassigned. + diff --git a/VKWIN.INC b/VKWIN.INC new file mode 100644 index 0000000..ffd9399 --- /dev/null +++ b/VKWIN.INC @@ -0,0 +1,131 @@ +;;; VKOEM.INC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Copyright (C) 1989,1990 by Microsoft Corp. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +if1 +%out Microsoft VKWIN.INC +endif +; ====================================================================== +; History +; +; 08 jun 89 peterbe Defined VK_NUMLOCK (VK_OEM_NUMBER) +; in VKOEM.INC, but this in WINDOWS.H !! +; 14 dec 88 peterbe Added VK_SNAPSHOT +; +; ====================================================================== +; Virtual Keys, Standard Set < 80H +; ====================================================================== + +VK_LBUTTON = 01H +VK_RBUTTON = 02H +VK_CANCEL = 03H + +; 4..7 undefined + +VK_BACK = 08H +VK_TAB = 09H + +; 0ah .. 0bh undefined + +VK_CLEAR = 0cH +VK_RETURN = 0dH + +VK_SHIFT = 10H +VK_CONTROL = 11H +VK_MENU = 12H +VK_PAUSE = 13H +VK_CAPITAL = 14H + ; 15h..1ah +VK_ESCAPE = 1bH + ; 1ch..1fh +VK_SPACE = 20H +VK_PRIOR = 21H ; page up +VK_NEXT = 22H ; page down +VK_END = 23H +VK_HOME = 24H +VK_LEFT = 25H +VK_UP = 26H +VK_RIGHT = 27H +VK_DOWN = 28H +VK_SELECT = 29H +VK_PRINT = 2aH ; only used by Nokia.. +VK_EXECUTE = 2bH +VK_SNAPSHOT = 2ch ; Printscreen key.. + +VK_INSERT = 2dH +VK_DELETE = 2eH +VK_HELP = 2fH +VK_0 = 30H +VK_1 = 31H +VK_2 = 32H +VK_3 = 33H +VK_4 = 34H +VK_5 = 35H +VK_6 = 36H +VK_7 = 37H +VK_8 = 38H +VK_9 = 39H + ; 40h +VK_A = 41H +VK_B = 42H +VK_C = 43H +VK_D = 44H +VK_E = 45H +VK_F = 46H +VK_G = 47H +VK_H = 48H +VK_I = 49H +VK_J = 4AH +VK_K = 4BH +VK_L = 4CH +VK_M = 4DH +VK_N = 4EH +VK_O = 4FH +VK_P = 50H +VK_Q = 51H +VK_R = 52H +VK_S = 53H +VK_T = 54H +VK_U = 55H +VK_V = 56H +VK_W = 57H +VK_X = 58H +VK_Y = 59H +VK_Z = 5AH + ; 5bh..5fh +VK_NUMPAD0 = 60H +VK_NUMPAD1 = 61H +VK_NUMPAD2 = 62H +VK_NUMPAD3 = 63H +VK_NUMPAD4 = 64H +VK_NUMPAD5 = 65H +VK_NUMPAD6 = 66H +VK_NUMPAD7 = 67H +VK_NUMPAD8 = 68H +VK_NUMPAD9 = 69H +VK_MULTIPLY = 6AH +VK_ADD = 6BH +VK_SEPARATER = 6CH +VK_SUBTRACT = 6DH +VK_DECIMAL = 6EH +VK_DIVIDE = 6FH + +VK_F1 = 70H +VK_F2 = 71H +VK_F3 = 72H +VK_F4 = 73H +VK_F5 = 74H +VK_F6 = 75H +VK_F7 = 76H +VK_F8 = 77H +VK_F9 = 78H +VK_F10 = 79H +VK_F11 = 7aH +VK_F12 = 7bH +VK_F13 = 7cH +VK_F14 = 7dH +VK_F15 = 7eH +VK_F16 = 7fH + +VK_NUMLOCK = 90H