Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <X11/extensions/XTest.h>
void Get_Mouse_positon()
{
Display *d;
Window inwin;
Window inchildwin;
int rootx, rooty;
int childx, childy;
Atom atom_type_prop;
int actual_format;
unsigned int mask;
unsigned long n_items, bytes_after_ret;
Window *props;
d = XOpenDisplay(NULL);
(void)XGetWindowProperty(d, DefaultRootWindow(d),
XInternAtom(d, "_NET_ACTIVE_WINDOW", True),
0, 1, False, AnyPropertyType,
&atom_type_prop, &actual_format,
&n_items, &bytes_after_ret, (unsigned char**)&props);
XQueryPointer(d, props[0], &inwin, &inchildwin,
&rootx, &rooty, &childx, &childy, &mask);
printf("relative to active window: %d,%d\n", childx, childy);
printf("absolute: %d,%d\n", rootx, rooty);
XFree(props);
(void)XCloseDisplay(d);
}
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <ncurses.h>
using namespace std;
int main()
{
int ch;
MEVENT event;
ch = getch();
if(ch == KEY_MOUSE)
{
if(getmouse(&event) == OK)
{
cout<<"Button Pressed";
}
}
return 0;
}