Closed snacke closed 6 years ago
After some rebooting it actually works! However, there are a few problems:
8 - key=ampersand 8 - key=a 8 - key=u 8 - key=m 8 - key=l 8 - key=semicolon
For some reason the ampersand (or something else) seems to activate Caps lock, so the letters are written in caps.
13 - click=1
This doesn't work when I click on menu buttons (like File, Edit, View etc). The buttons just "blink" and the menu doesn't open. It behaves as if I had double-clicked the button very quickly.
14 - click=1 14 - key=Delete
The delete command behaves like "press and hold", even though I have released the mouse button. It keeps on deleting text until I press any keyboard button.
The mouse behaves normally on a Windows computer (except the left-click button, that's why I want to use button 13 for clicking). Any suggestions are highly appreciated!
No clue about the ampersand thing, is it just with the ampersand or you are seeing funny things with other special characters like, for exmaple, $? I think I know why you are seeing the Delete thing, by putting it in a macro you are triggering the keydown but not the keyup, that is not what should happend though I guess. Try using toggle instead of key. As in: 14-click=1 14-toggle=Delete 14-delay=100 14-toggle=Delete
The click action simulates a click of 12 ms of duration ( http://www.semicomplete.com/projects/xdotool/xdotool.xhtml#mouse_commands ), no matter the time the mouse key is being pressed. Probably these menus you say need a longer click time. The solution here would be to use xdotool mouseodown/mouseup commands instead of click, that way pressing the mouse button would be equivalent to pressing the click button in the mouse. Ill open a request with it, it is not hard to implement! But some special handling is necessary when putting click in a macro, as I guess you want to specify only the click, and pheraps a click time.
Hi, I'm the author of a different naga macro daemon at https://github.com/Ameliorate/nmfd and https://github.com/Ameliorate/anm3, and I'm also interested in supporting your mouse. Can you run the following command and reply with it's output?
ls -la /dev/input/by-id/
Feel free to remove the lines that don't refer to razer or naga in any way.
Thank you very much for both of your replies! I will do what you suggest and get back to you in a few days! :)
Hi @RaulPPelaez, thank you for your suggestions. The mousedown/mouseup commands would be very useful, since this would also enable clicking and dragging to move files, select a line of text etc.
Unfortunately, the toggle command didn't solve the Delete problem. I have tried delays of 50, 100, 200 and 300 ms, but the result is the same as earlier.
Regarding the special characters, I've been trying several things without success. It seems like the problems occur only when using a macro with more than one button. A single key=Caps_Lock
or key=dollar
works fine without any problems. However, this is what happens when I use other combinations:
8 - key=ampersand 8 - key=Caps_Lock 8 - key=a 8 - key=u 8 - key=m 8 - key=l 8 - key=semicolon
Result: ä
and caps lock
8 - key=ampersand 8 - key=Caps_Lock 8 - key=a 8 - key=u 8 - key=m 8 - key=l 8 - key=semicolon 8 - key=Caps_Lock
Result: ä
and caps lock
8 - key=ampersand 8 - key=Caps_Lock 8 - key=a 8 - key=u 8 - key=m 8 - key=l 8 - key=semicolon 8 - key=Caps_Lock 8 - key=Caps_Lock
Result: ä
and caps lock
8 - key=ampersand 8 - key=Shift_L 8 - key=a 8 - key=u 8 - key=m 8 - key=l 8 - key=semicolon
Result: Ä
and no caps lock
8 - key=Caps_Lock 8 - key=ampersand 8 - key=Shift_L 8 - key=a 8 - key=u 8 - key=m 8 - key=l 8 - key=semicolon
Result: ä
and caps lock
8 - key=Caps_Lock 8 - key=ampersand 8 - key=Shift_L 8 - key=a 8 - key=u 8 - key=m 8 - key=l 8 - key=semicolon 8 - key=Caps_Lock
Result: ä
and caps lock
8 - key=dollar 8 - key=a 8 - key=u 8 - key=m 8 - key=l 8 - key=semicolon
Result: $ª®→nŋ and no caps lock (the letters are written as if AltGr was held down)
In the last case it looks as if you press down AltGr to write $
, and continue writing without releasing AltGr. I don't understand the ampersand case though, because you never press caps lock in order to write &
. That's why I tried using shift commands, but I can't find any workaround giving the desired result. Thank you for your patience if you have been reading all this text. ;)
Hi @Ameliorate, this is the output I obtained (entries related to Razer in bold):
total 0 drwxr-xr-x 2 root root 140 mar 30 17:39 . drwxr-xr-x 4 root root 360 mar 30 17:39 .. lrwxrwxrwx 1 root root 9 mar 30 17:37 usb-2516_Xornet_gaming_mouse-event-mouse -> ../event3 lrwxrwxrwx 1 root root 9 mar 30 17:37 usb-2516_Xornet_gaming_mouse-mouse -> ../mouse0 lrwxrwxrwx 1 root root 9 mar 30 17:39 usb-Razer_Razer_Naga-event-mouse -> ../event4 lrwxrwxrwx 1 root root 10 mar 30 17:39 usb-Razer_Razer_Naga-if01-event-kbd -> ../event10 lrwxrwxrwx 1 root root 9 mar 30 17:39 usb-Razer_Razer_Naga-mouse -> ../mouse1
I wish you good luck, and feel free to ask me for further information if needed!
Another short note to @RaulPPelaez:
14 - click=1 14 - toggle=Delete 14 - delay=100 14 - toggle=Delete
When I use this command, at first the cursor is inserted, then one character is deleted followed by the delay, and then the "mass deleting" starts. In other words, it seems to be the last toggle=Delete
that initiates the continuous deleting.
@snacke I think that the Naga 2009 should work with nmfd. Please download it at https://github.com/Ameliorate/nmfd and then run make run
in the directory you downloaded it to. Pressing the side buttons on your mouse should print the button's number.
Hi again @Ameliorate, now I've tried nmfd and it works as you said. Button numbers are printed in the terminal according to your description, with plus, minus and colon signs. However, if I press the mouse buttons in a text file, nothing is printed there (only in the terminal). Sorry for a stupid question, but can nmfd be used for assigning macros to buttons?
@snacke That is correct. You are supposed to pipe nmfd into another application to set macros. I made anm3 which does this, however I never got around to really documenting it. You can make sense of most of it by reading amn3rc.awk and anm3.awk if you already know awk.
I think the double action bug I just fixed (or at least I think I did) could be the cause of the issues you are experiencing. Please git pull and let me know if the problems persist! Thanks!
Also I have been experimenting and I saw that at least in my system: 1- xdotool keydown Shift_L does nothing (this would be equivalent to the action "toggle"). Only Shift_R does the right thing, and using Shift_R with the "key" action in a macro just presses and releases the key before going to the next action, so it will not affect the next key... You should use toggle for that, but remember to use toggle again or the key will remain pressed. 2-"shift" does nothing by itself, it has to be used along other keys as a modifier, i.e shift+l or ctrl+shift+t (you can put this in the mapping.txt files) 3- Caps_Lock makes sense only if it is used with the "key" action (keeping Caps_Lock pressed as toggle simulates could be doing funny things).
I think now all this things you are seeing are related to xdotool. You can try this by putting the xdotool orders in a script instead of using naga, for example: 1-key=h 1-key=Caps_Lock 1-key=e 1-key=l 1-key=l 1-key=Caps_Lock 1-toggle=Shift_R 1-key=o 1-toggle=Shift_R
This should print hELLO
And it is equivalent to this script:
xdotool key --window getactivewindow h xdotool key --window getactivewindow Caps_Lock xdotool key --window getactivewindow e xdotool key --window getactivewindow l xdotool key --window getactivewindow l xdotool key --window getactivewindow Caps_Lock xdotool keydown --window getactivewindow Shift_R xdotool key --window getactivewindow o xdotool keyup --window getactivewindow Shift_R
Let me know if you try!
Hi @RaulPPelaez and thank you again for your work! I actually sometimes had the double action issue as well, but I thought it was my mouse. :P
I tried the following macro that you proposed:
1-key=h 1-key=Caps_Lock 1-key=e 1-key=l 1-key=l 1-key=Caps_Lock 1-toggle=Shift_R 1-key=o 1-toggle=Shift_R
Still Caps lock is left on after execution, but the most strange thing is that it writes only one "L"! The first time it writes hELo
and turns Caps lock on, the second time it writes helO
and turns Caps lock off, etc. A very strange behavior I must say :S
However, I saved the xdotool commands into a script and executed it from the terminal, and it prints hELLO
as it should. Maybe it would work for me to save my macros into scripts with xdotool commands and execute them using Naga Keypad Mapper?
This is probably fixed in 8e8ad1d805ab40d7f02c9a9349cf4177edd2d665. Please reopen otherwise.
Hi! This daemon seems to be very useful, and I would like to use it for Razer Naga 2009 (the oldest Naga version) on Linux Mint 18.3. Would that be possible to achieve? :)