Multiple declaration for 'oldHotkey' - C (СИ)
Формулировка задачи:
#include < dos.h > #include < conio.h > #include < stdio.h > void interrupt far (*oldKeyHandler)(...);//Blocked f6 void interrupt far (*oldHotkey)(...);//fiLter shift+alt+f unsigned char SCAN_F6= 64; unsigned char SCAN_Shift= 16; unsigned char SCAN_ALT= 12; unsigned char SCAN_f= 102; int keycount=1;//count shift+alt+f ///////////////////////////////////////////////////////////////////////////////// void interrupt far keyHandler(...) { char key = inport(0x60); //blocked f6 if ((key==SCAN_F6) && (keycount%2)==0) { char ctr = inport(0x61); outport(0x61, ctr | 0x80); outport(0x61, ctr); outport(0x20, 0x20); printf("key F6 is blocked."); textattr(0x0f); } else oldKeyHandler(); } ////////////////////////////////////////////////////////////////////// void interrupt far oldHotkey(...) { char key = inport(0x60); if (key==SCAN_Shift) &&(key==SCAN_ALT)&& (key==SCAN_f){ keycount=keycount+1; } } ///////////////////////////////////////////////////////////////////////////// int main() { clrscr(); textattr(0x0a); cprintf(" "); cprintf(" Laboratorna rabota #2"); cprintf(" "); cprintf(" Control keyboard"); cprintf(" "); textattr(0x0c); cprintf("\n\n\r"hot" combination: "); textattr(0x0a); cprintf(" Shift+Alt+f\n\r"); textattr(0x0b); oldKeyHandler = getvect(0x09); setvect(0x09, keyHandler); oldHotkey = getvect(0x09); setvect(0x09, oldHotkey); char c; do { c = getch(); if (c==0) {printf("*"); c=getch(); } printf("\t%c : %u\n", c, (unsigned int)c); } while(c!=27); return 0; }
Решение задачи: «Multiple declaration for 'oldHotkey'»
textual
Листинг программы
void interrupt far oldHotkey(...)
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д