Thread View: comp.sys.ibm.pc
1 messages
1 total messages
Started by Norman C. Kluksdahl
Sat, 09 Jan 1993 22:07
problem with cb libgrx in djgpp
Author: Norman C. Kluksdahl
Date: Sat, 09 Jan 1993 22:07
Date: Sat, 09 Jan 1993 22:07
78 lines
2770 bytes
2770 bytes
Can anyone help with this?
I am compiling some code with the GCC compiler from the djgpp project,
but I keep running into a bug. This problem is evident on several
different 386SX, 386, and 486 platforms, so I have discounted a problem
with my specific machine.
I am attempting to use the libgrx library mouse functions; specifically,
I am trying to use the queued keyboard and mouse interrupts, as directed
in the documentation for libgrx. But, my problem is that even the test
program won't run, and neither will my own sample code. If anyone can
help with this, I would be greatly appreciative.
**************** code compiled **********************************
#include <grx.h>
#include <mousex.h>
#include <stdio.h>
#include <stdlib.h>
void main()
{
GrSetMode(GR_width_height_color_graphics,x,y,c);
mt();
GrSetMode(GR_default_text);
exit(0);
}
mt()
{
MouseEvent evt;
char ii = 0;
FILE *fp, *fopen();
fp = fopen("mt_int.out", "w");
if(MouseDetect())
{
MouseEventMode(1);
MouseInit();
MouseDisplayCursor();
MouseEventEnable(1,1);
MouseSetColors(GrAllocColor(255,0,0),GrBlack());
GrClearScreen(GrAllocColor(0,0,128));
while(ii != 'q')
{
MouseGetEvent((M_KEYPRESS | M_BUTTON_CHANGE | M_POLL ),&evt);
if(evt.flags & M_KEYPRESS)
{
fprintf(fp,"key pressed = %c\n",evt.key);
ii = evt.key;
}
if(evt.flags & M_BUTTON_CHANGE)
{
if(evt.flags & M_LEFT_DOWN)
fprintf(fp,"left button down at %d %d\n",evt.x, evt.y);
if(evt.flags & M_LEFT_UP)
fprintf(fp,"left button up at %d %d\n",evt.x, evt.y);
if(evt.flags & M_MIDDLE_DOWN)
fprintf(fp,"middle button down at %d %d\n",evt.x, evt.y);
if(evt.flags & M_MIDDLE_UP)
fprintf(fp,"middle button up at %d %d\n",evt.x, evt.y);
if(evt.flags & M_RIGHT_DOWN)
fprintf(fp,"right button down at %d %d\n",evt.x, evt.y);
if(evt.flags & M_RIGHT_UP)
fprintf(fp,"right button up at %d %d\n",evt.x, evt.y);
}
}
MouseUnInit();
}
}
********************** end of code *************************
Thanks in advance for any help which can be provided.
=====================================================================
Norman Kluksdahl
moe@nuchat.sccsi.com
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads