I am playing cs1.6 on Ubuntu 20.04 LTS using wine-5.0 (Ubuntu 5.0-3ubuntu1), but I have this weird problem of mouse click in the game, only with pistols and guns, whenever I fast click to shoot after two/one bullets fired theres a delay (mouse dont even shoot bullets for a second) in shooting.
But when I use Enter key for shooting the bullets get fired smoothly (the whole round).
Now I am looking for some way to simulate Enter key pressed on mouse left click.
Can we do that ?
Best Answer
For those who want to achieve this on Linux,
I made a c++ program to capture mouse click and have
Enter
key pressed just after.In the above program I tried to read the mouse events and data directly from the device in "/dev/input/by-id", my device events file name is "usb-Logitech_USB_Receiver-if01-event-mouse".
Once you have the events in a variable (i.e event), my mouse left button code is 272, not sure it is the universal code number for mouse left button, event.type = 1 ( not sure about this even ), event.value = 1 is mouse button down/pressed event whereas event.value = 0 is mouse up/released event.
Once mouse is pressed we have to hit
Enter
key on keyboard, for that I usedxdotool
, make sure you installedxdotool
.xdotool key Return
triggers the Enter key pressed event on keyboard.compile it to produce an executable named
mouse
then you can run it using
sudo ./mouse&
&
is to run the command in background.Thats it, now whenever your mouse left key is pressed, the
Enter
key on your keyboard is pressed until you release the button click.Note: This program uses 100% cpu coz of the infinite while loop, but its normal.
I tested this on cs1.6 when I fired from pistol using mouse left key down, whole round fired automatically coz of
Enter
key pressed till I held the mouse key up.Make sure you put
Enter
key to Fire in keyboard shotcuts in settings of cs1.6, I haveEnter
key as primary and-
key as alternate to Fire in keyboard shortcuts.