Returns the dimension of the TWindow Uses XGetWindowAttributes to retrieve the dimensions of the stored TWindow. Uses TKeyInput class from lazarus to fake a keydown event. Uses TKeyInput class from lazarus to fake a keyup event. Should return true if the given key is held down. NOT YET IMPLEMENTED ON LINUX Uses XGetWindowAttributes to check if the currently selected window is valid. If we have not recieved an error, the window is valid. Selects the current client as input focus for the X11 windowing system Uses XGetImage to get the pixel data of the currently stored TWindow. The image data is passed as result. Frees the XImage object called buffer if it is set. This should be called once the ReturnData result is no longer required. Uses XQueryPointer to query the current mouse position relative to the stored TWindow. Uses XWarpPointer to move the mouse to the specific position relative to the stored TWindow. Uses XTest to fake a mouse button press. Uses XTest to fake a mouse button release. Uses XQueryPointer to return if the given mouse button is held. Linux/X11 implementation of the TIOManager Set the stored TWindow to the passed TNativeWindow. Set the desktop as stored TWindow. Open the X11 connection Close the X11 connection. X Error Handler. This is extremely hacky, but also very useful. We have to install a X error handler, because otherwise X will terminate out entire app on error. Since we want the right thread to recieve the right error, we have to fiddle a bit with threadvars, mutexes / semaphores. Another problem is that the script thread is initialised on the main thread. This means that all (threadvar!) semaphores initialised on the mainthread are NOT initialised on the script thread, which has yet to be started. Therefore, we check if it hasn't been created yet. ** Horrible solution, but WFM ** This is the Handler function. Returns true if we have received an error Returns the stored TWindow