7 void_func oldMouseVector, oldKeyVector;
11 // do something on mouse press/release
16 // call previous routine
22 // do something on key press/release
27 // call previous routine
31 void hook_into_system(void)
33 // hook into system vectors - preserve old value
34 oldMouseVector = mouseVector;
36 oldKeyVector = keyVector;
40 void remove_hooks(void)
42 mouseVector = oldMouseVector;
43 keyVector = oldKeyVector;
51 // To make cc65 do something for you before exiting you might register
52 // a function to be called using atexit call. #include <stdlib.h> then and
54 atexit(&remove_hooks);
57 cputsxy(0,1, CBOLDON "Just" COUTLINEON "a " CITALICON "string." CPLAINTEXT );
61 // This program will loop forever though
64 // If not using atexit() you have to remember about restoring system vectors
65 // right before exiting your application. Otherwise the system will most