Skip to content

Tag: c++

Hook and block globally mouse in X11

I need to hook globally mouse clicks and block last click if delay between two clicks is less than was set. I wrote it for windows using WM_MOUSE_LL hook. I was unable to find any solution for me. Is it even possible to globally block mouse click in X11 ? Windows full code Answer As far as I know the

Executing Bash commands using C code

I’m trying to use file.cpp to execute some simple bash commands. Code works for commands like ls, gedit, echo but fails at cd command. Here is my file.cpp: I execute it after compiling using ./file and my terminal output is, Current directory didn’t change to /etc. I have tried changing cd /etc to…

VTK/ITK project Requested modules not available on ubuntu

I would like to configure with cmake-gui a VTK/ITK project on ubuntu with QT and I have this error message. I don’t understand. How I can pass this error ? Answer When configuring VTK with CMake, you need to enable either vtkGUISupportQtOpenGL or VTK_Group_Qt. You can also change that setting now, then …

How to use get_random_bytes() in linux kernel module?

I have made simple kernel module. I printed out rand variable using seq_printf function. cb_funct function is called five times. Below is the result. random number : 66 random number : -5 random number : 135 random number : 178 random number : -42 Why negative variable is printed out? How to use get_random_by…

compatibility issues with regex between Mac and Linux machines

Original Question: “I developed a program on my Mac using Xcode 8’s latest LLVM 8 compiler (clang 8/3.8?) which made heavy use of regular expressions out of c++14. I was then unable to get my code to give me the correct output when running on linux. There seem to be some regular expression compati…

How to run windows service on Linux or Mac OS [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question I have created windows service and it is working fine on Windows OS ,but we need to run this …