delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/11/18:03:41

From: Reinier Heeres <rwh AT worldonline DOT nl>
Newsgroups: comp.os.msdos.djgpp
Subject: Keyboard handler trouble
Date: Wed, 11 Mar 1998 19:23:29 +0100
Organization: World Online
Lines: 38
Message-ID: <3506D6A0.E36FE6F0@worldonline.nl>
Reply-To: rwh AT worldonline DOT nl
NNTP-Posting-Host: alkmr1-p65.worldonline.nl
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi!

I've got this code:

_go32_dpmi_seginfo old_key,new_key;

void keyboard_interrupt(void) {
  }

void end_keyboard_interrupt(void) {
  }

void init_keyboard(void) {
  int i;
  for(i=0;i<256;i++) key_table[i]=ckey_up;
  _go32_dpmi_lock_data(&key_table,256);
 _go32_dpmi_lock_code(&keyboard_interrupt,(int)end_keyboard_interrupt-(int)keyboard_int);

  _go32_dpmi_get_protected_mode_interrupt_vector(keyboard_int,&old_key);

  new_key.pm_offset=(int)keyboard_interrupt;
  _go32_dpmi_allocate_iret_wrapper(&new_key);
  _go32_dpmi_set_protected_mode_interrupt_vector(keyboard_int,&new_key);

  }

void deinit_keyboard(void) {
  _go32_dpmi_set_protected_mode_interrupt_vector(keyboard_int,&old_key);

  _go32_dpmi_free_iret_wrapper(&new_key);
  }

This code works. But when I finish my program, and deinit_keyboard() has
been called, no keyboard handler seems to be present, could anybody tell
me what the problem might be?

Thanks, Reinier

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019