Re: David Cuny's Editor

new topic     » goto parent     » topic index » view thread      » older message » newer message

David wrote:

>You forgot to mention that the number keys must be from the *keypad*,
>so the editor can distinguish between Alt+1 (toggle to document #1) and
>Alt+1+5+5 (ascii 155). If I can figure out how to distinguish keypad keys
>from other keys, I'll try to support this.

To distinguish keypad keys from others keys, you have to read the scan code
which are
different for keypad numerics than those of the upper row.

If you use bios interrupt #16 to read the characters then the scan code is in AH

global function ReadKey()
-- read a key from keyboard buffer (wait for a key)
-- return {Scan code, ASCII code}
-- this return F11 and F12 function keys which get_key() doesn't

sequence r
  r = repeat(0,10)
  r[REG_AX] = #1000  -- read extended keyboard
  r = dos_interrupt(#16,r)
  return {floor(r[REG_AX]/256),remainder(r[REG_AX],256)}
end function -- ReadKey()

scan code for keypad numbers are:

0   52
1   4F
2   50
3   51
4   4B
5   4C
6   4D
7   47
8   48
9   49


Jacques Deschenes
Baie-Comeau, Quebec
Canada
desja at quebectel.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu