First post, by kin
Anyone know a TSR that allows you to remap specific keys?
For example a,w,s,d > arrow left, arrow up, arrow down, arrow right.
Only thing I found was using ansi.sys, but I'm not sure if a dos application will overrule that.
Also, I found some flat assembly code, but I'm not quite a programmer... and uh you need to compile that to 16-bit .exe?:
; Modified Keyboard Entry - 13/10/2009
ORG 256
mov ax,cs
mov ss,ax
mov sp,MyStack+64*2
mov ds,ax
mov es,ax
; Some arbitrary modification
mov byte [Table+"a"],"z"
mov byte [Table+"z"],"a"
; Save existing Keyboard Interrupt Vector
push es
mov ax,3509h
int 21h ;DOS 'Get Interrupt Vector'
mov [Old_09h],bx
mov [Old_09h+2],es
pop es
; Setup new Keyboard Interrupt Vector
mov dx,New_09h
mov ax,2509h
int 21h ;DOS 'Set Interrupt Vector'
; Prompt user action
mov dx,Msg1
mov ah,09h
int 21h ;DOS 'Display String'
MainLoop:
mov ah,01h
int 21h ;DOS 'Keyboard Input & Echo'
cmp al,27 ;<ESC> ?
jne MainLoop
; Restore old Keyboard Interrupt Vector
push ds
lds dx,[Old_09h]
mov ax,2509h
int 21h ;DOS 'Set Interrupt Vector'
pop ds
; Terminate
mov dx,Msg2
mov ah,09h
int 21h ;DOS 'Display String'
mov ax,4C00h
int 21h ;DOS 'Terminate/ReturnCode'
; ----------------------------------------------
New_09h:
push ax bx si ds
mov ax,40h ;BIOS_DataSegment
mov ds,ax
mov si,[001Ch] ;BIOS_KeyboardBufferTailPointer
; Let BIOS take care of the hardware
pushf
call far dword [cs:Old_09h]
cmp si,[001Ch] ;BIOS_KeyboardBufferTailPointer
je .t1 ;No new key in buffer
mov al,[si] ;ASCII (SCAN in [si+1])
mov bx,Table
xlat [cs:bx]
mov [si],al ;Updated ASCII
.t1:
pop ds si bx ax
iret
; ----------------------------------------------
ALIGN 4
Old_09h:
dd 0
Table:
times 256 db %-1
MyStack:
dw 64 dup (0)
Msg1:
db 'Watch <a> and <z> being swapped...',13,10
db 'Please press some keys. <ESC> exits!',13,10,'$'
Msg2:
db "-- That's all folks",13,10,'$'
; -----------------------------------------------