Assigning a new character to a key 
Author Message
 Assigning a new character to a key

I need to assign to the key combination ALTgr+E the ascii code 238 by a
small TSR. Could anyone help me?

Thanks
--
Wilmer Ricciotti



Wed, 04 Jul 2001 03:00:00 GMT  
 Assigning a new character to a key
|I need to assign to the key combination ALTgr+E the ascii code 238 by a
|small TSR. Could anyone help me?

I haven't tested this, but it should work:

Install an INT15/AH=4Fh handler. The INT15/AH=4F will be called
by the IRQ1 handler before it processes a keyboard scancode.
If you return with CF=0, the IRQ1 handler will ignore the scancode.

ALTGrPressed db 0
INT15:
    pushf
    push   ax
    cmp    ah,4Fh
    jne    ChainINT15
;Now, AL is the scan code
    mov    ah,01h    ;Assume ALT scancode
    cmp    al,38h    ;ALT scancode?
    je     short CheckALT
    mov    ah,00h    ;Assume ALT break code
    cmp    al,0B8h   ;ALT break code?
    jne    NotALT
CheckALT:
    push   ds
    push   0000h
    pop    ds
    test   byte ptr ds:[0496h],02h ;Was last scancode E0h?
    pop    ds
    jz     ChainINT15 ;Exit if last scancode wasn't E0
    mov    cs:ALTGrPressed,ah ;0 or 1
    jmp    ChainINT15
NotALT:
    cmp    al,12h    ;Scancode for E; might be different for you
    jne    ChainINT15
    cmp    ALTGrPressed,0 ;Is right ALT pressed?
    je     ChainINT15 ;Exit if not
    pop    ax
    popf
    mov    al,scancode for ascii 238 ;Add the SCANCODE (not ASCII) here
    iret
ChainINT15:
    pop    ax
    popf
    jmp    cs:OldINT15



Wed, 04 Jul 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. how to assign key such as ALT F, ALT G to a control

2. Character Assign/Read to Cardinal

3. Assigning keys to VRML events.

4. Assigning a number string to a character variable

5. (or (gethash key table) (setf (gethash key table) new-value))

6. how to split each new line into a list, considering quoted new line characters

7. wire assign vs continous assign

8. assigning to None vs. assigning to as

9. assigning new numbers to same variables?

10. Getting Return Key to Not Send Return Character?

11. Foreign characters in key-field of TPS file.

12. function keys and embedded ascii extension characters

 

 
Powered by phpBB® Forum Software