[Xpert]Grab key, mouse to a single window

2002-07-08 Thread root

Hi Xperts,

Can anyone help me how to grab all key events and send
them to a single window. Also when i do any mouse operations
it  should take only those operations done on that window.

Like say i opened a dialog box. Until i close the window the focus
shouldn't go to any other window. Any key i press should be directed
to the dialog

I tried something and i have attached. but the window couldn't
get  the key and mouse  input

Can somebody give me clear picture!

Thanks,
Jeyasudha.


#include 
#include 
#include 
#include 
#include 
#include 
#include 


Display *dis;
Window win;
XEvent report;
int i=0;

int main()
{
XWindowChanges windowChanges;
Window screeninput;
XSetWindowAttributes windowAttributes;

dis = XOpenDisplay(NULL);
win = XCreateSimpleWindow(dis, RootWindow(dis, 0), \
  1,1,300,300,0, BlackPixel(dis,0), BlackPixel(dis,0));
XMapWindow(dis,win);
fprintf(stdout, "The display is %d \n", dis);
XFlush(dis);
XSync(dis, False);
XSelectInput(dis,win, EnterWindowMask| LeaveWindowMask| ExposureMask| 
KeyPressMask| ButtonPressMask| StructureNotifyMask| ResizeRedirectMask 
|StructureNotifyMask | SubstructureNotifyMask | PropertyChangeMask );
if (XGrabPointer(dis,
 win,
 False, /* owner_events */
 PointerMotionMask | PointerMotionHintMask |  ButtonPressMask | 
ButtonReleaseMask,  /* event mask */
 GrabModeAsync, /* pointer_mode */
 GrabModeAsync, /* keyboard_mode */
 None,  /* confine_to window */
 None,  /* cursor */
 CurrentTime) == GrabSuccess)
{
printf("Grabbed the mouse pointer"); 

if (XGrabKeyboard(dis,
 win,
 False, /* owner_events */
 GrabModeAsync, /* pointer_mode */
 GrabModeAsync, /* keyboard_mode */
 CurrentTime) == GrabFrozen)
{
printf("Grabbed the keyboard\n");   
}
else
{
printf("Failed Grabbing the keyboard first time \n");
XUngrabKeyboard (dis, CurrentTime);
if (XGrabKeyboard(dis,
 RootWindow(dis,0),
 False, /* owner_events */
 GrabModeAsync, /* pointer_mode */
 GrabModeAsync, /* keyboard_mode */
 CurrentTime) == GrabFrozen)
{
printf("Grabbed the keyboard second time\n");
}
else
{
printf("Failed grabbing keyboard second time");
}
}

}
   else
{
printf("Cannot Grab the mouse pointer"); 
XUngrabPointer (dis, CurrentTime);

if (XGrabPointer(dis,
 RootWindow(dis,0),
 False, /* owner_events */
 PointerMotionMask | PointerMotionHintMask |  ButtonPressMask | 
ButtonReleaseMask,  /* event mask */
 GrabModeAsync, /* pointer_mode */
 GrabModeAsync, /* keyboard_mode */
 None,  /* confine_to window */
 None,  /* cursor */
 CurrentTime) == GrabSuccess)
  printf ("Grabbed the mouse pointer second time \n");
else
  printf ("Failed the mouse pointer second time \n");
}
 /*   
windowAttributes.event_mask = ButtonPressMask | EnterWindowMask;
windowAttributes.override_redirect = True;
screeninput = XCreateWindow (dis, RootWindow(dis,0), 0, 0,
   DisplayWidth (dis, XDefaultScreen(dis)),
   DisplayHeight (dis, XDefaultScreen(dis)),
   0,
   0,
   InputOnly,
   CopyFromParent,
   CWEventMask | CWOverrideRedirect | CWCursor,
   &windowAttributes);

windowChanges.sibling = win;
windowChanges.stack_mode = Below;
XConfigureWindow (dis,screeninput,
  CWSibling | CWStackMode, &windowChanges);
*/
while(1)
{
XNextEvent(dis, &report);
fprintf(stdout, "Event type is %d", report.type);
switch(report.type)
{

case EnterNotify:
i++;
fprintf(stdout, "U have entered the window %d", i);
break;

   

[Xpert]hostname - f sucks

2002-01-28 Thread root


folks, the problem i`m adressing to is the fact that xfree86 4.2.0 
(as does 4.1.0 and 3.3.6) makes an assumption that hostname 
accepts the -f otopin, which isnt necessarily true, 
(infact in most cases its not).

this leads to the hostname of the boxen being brutally forced to be -f

which is not cool :)

regards, Samium Gromoff
___
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert



[Xpert]Re: 2 mice

2002-01-21 Thread root

hi tapsel,

I also have something like 2 mice 
1 aiptek pctablet
1 touchpad
my configuration:

section "ServerLayout"
Identifier "Simple Layout"
Screen "Screen 1" 0 0
InputDevice "Mouse1" "SendCoreEvents" # touchpad
InputDevice"Keyboard1" "CoreKeyboard"
InputDevice "Aiptek" "CorePointer"# temp. connected usb
pctablet (hid interface)
EndSection

markus
___
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert



[Xpert]#build failure

2002-01-19 Thread root

make[4]: Entering directory `/arch/xc/lib/GL/GL'
make[4]: *** No rule to make target `../../../lib/GL/glx/?*.o', needed by 
`libGL.so.1.2'.  Stop.

cheers, Samium Gromoff

___
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert



Re: [Xpert]1600x1200 on VIA apollo PLE133 ?

2001-11-15 Thread root

Am Donnerstag, 15. November 2001 13:06 schrieb Lars Silvén:
> I have tryed to get the 1600x1200 resolution on a PLE133 chipset.
> The monitor I'm using is a NEC FE950+: hor freq 31-96kHz vert freq
> 50-160Hz. I have tried both the vesa and trident (the chip is suposed to
> have the trident blade3D integrated) driver but non of these works. It just
> wont take the 1600x1200 but 1280x1024 works fine. trident craches after any
> valid ctrl-alt-* key press and has to be restarted; this is no problems for
> vesa.
> I would be glad if anyone has any suggestions. Other drivers or any
> special settings that I could try. I have a used the debian wody dist to
> install xfree86-4 and also tried xf86config and some editing of the
> XF86Config-4 file. 1600x1200 works fine on win2k so the HW is capable of
> doing it.
>
> Thanks
>   Lars
>
> ___
> Xpert mailing list
> [EMAIL PROTECTED]
> http://XFree86.Org/mailman/listinfo/xpert


Maybe somethings happen in your XF86Config-4 , Get your Monitor and Videocard 
Manual and search for DDC compliance.

If both have this you can add in the Module Section   

Load "ddc"

and XFree86 gets the needed Modelines for all possible Resolutions so it 
works with your 
Hardware.
___
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert



[Xpert]xlsclients

2001-09-05 Thread root

I get the source code for xlsclients (xlsclients.c) , when I compile
(gcc xlsclients.c -lgdk -lX11 -lgtk) the compiler rturn the message : In
function "lookat": undefined reference to "XmuClientWindow"
collect2 :ld returned 1 exit status.
I don`t know where is defined the XmuClientWindow  function , I have
included WinUtil.h but I receive  the same message. I'm running  RedHat
7.1.


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

___
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert