Coder Social home page Coder Social logo

Comments (12)

TheGuardianWolf avatar TheGuardianWolf commented on June 7, 2024

What do you mean numbers still go through? You mean your keypresses trigger two actions?

from naga_keypadmapper.

apocatarsis avatar apocatarsis commented on June 7, 2024

See 2) in USAGE in README

In order to get rid of the original bindings it disables the keypad using xinput as follows:

$ xinput set-int-prop [id] "Device Enabled" 8 0
where [id] is the id number of the keypad returned by $ xinput.

Does not that get rid of the original bindings?

Also in step 4)

  1. You may have to also run

$ xinput set-button-map [id2] 1 2 3 4 5 6 7 11 10 8 9 13 14 15

where [id2] is the id number of the pointer device returned by xinput - in case of naga 2014 you also have to check which of those two has more than 7 numbers by typing xinput get-button-map [id2]. Although this seems to be unnecesary in some systems (i.e CentOS 7)

I cannot tell, but it seems naga 2014 has a special treatment. Be sure your issue is not related with this!

I am not sure where the "Invalid format 0" is coming from. It appears that the naga daemon is working normally. So it is probably coming from some of the xinput calls above naga in nagastart.sh, could you pinpoint which one? (By calling nagastart.sh with bash -x nagastart.sh i.e)

from naga_keypadmapper.

TheGuardianWolf avatar TheGuardianWolf commented on June 7, 2024

I've also got a modification to the code for ioctl to exclusively capture device input, since I was too lazy to do the xinput mods. This means no tweaking with device settings.

It's on my Linux install somewhere, I'll grab it when I next boot into it.

EDIT: Actually never mind, I came from your thread on reddit, the code you have here is a lot different to the source, not sure if you're still using ioctl anymore.

from naga_keypadmapper.

SuperCuber avatar SuperCuber commented on June 7, 2024

This is the output with -x... I can't really tell what's going on tbh.
http://pastebin.com/H0WM92Dc

As to what I mean, I mean that when I press 1, both the special function happens AND the program gets a "1" written into it

from naga_keypadmapper.

TheGuardianWolf avatar TheGuardianWolf commented on June 7, 2024

Try inserting the following before the while(1) loop in the run() function in file naga.cpp:
ioctl(side_btn_fd, EVIOCGRAB, 1);
ioctl(extra_btn_fd, EVIOCGRAB, 1);

Assuming this works, the application will gain exclusive control of the side key inputs until you exit it.

from naga_keypadmapper.

SuperCuber avatar SuperCuber commented on June 7, 2024

It does work, however seems like the application also gains control of the mouse itself, as I can't move it... And the Invalid format 0 persists, too

from naga_keypadmapper.

TheGuardianWolf avatar TheGuardianWolf commented on June 7, 2024

Alright, drop the second ioctl, and see what happens.

I have no idea about the invalid format 0 though but it seems to be 'working'.

from naga_keypadmapper.

SuperCuber avatar SuperCuber commented on June 7, 2024

That works! 🥇

from naga_keypadmapper.

TheGuardianWolf avatar TheGuardianWolf commented on June 7, 2024

Guess my mods on the original script still works on this app, I'll leave the 'Invalid format 0' to apocatarsis since I don't personally have a Naga, I use the Naga Hex v2.

from naga_keypadmapper.

apocatarsis avatar apocatarsis commented on June 7, 2024

Hey I like the ioctl magic, thats cool!! Thanks! I'll add it to the master when I have a little time to test it. Or open a new branch and do it yourself if you want!

From the pastebin I see the complaining line is:
$ xinput set-int-prop 15 16 'Device Enabled' 8 0
This is incorrect, there should be either 15 or 16, only one id. Thats why it fails.

nagastart.sh is detecting wrong the xinput id of your Naga side keyboard, it appears as it is showing twice, as grep gives back two lines. Something that I havent see in the two nagas I have been able to test this myself...
Could you post the output of $xinput please?? that way ill should be able to generalize the script.

Either way, if the ioctl lines by @TheGuardianWolf work as expected some of the xinput lines in nagastart could be dropped. This is starting to look less like a cluster of hacks!! super cool! thanks guys!

Lastly, @SuperCuber, if I am not mistaken, with the ioctl line, you can just drop the lines

NAGAID1=$(xinput | grep Naga | grep keyboard | cut -d= -f2 | cut -b1-2)
xinput set-int-prop $NAGAID1 "Device Enabled" 8 0

in your nagastart.sh and it should work without complaining.

from naga_keypadmapper.

TheGuardianWolf avatar TheGuardianWolf commented on June 7, 2024

I've been looking to write an extension for razer-cfg for my Naga Hex V2 since it's not supported, does the Naga not have razer-cfg support or such for the side keys as well?

from naga_keypadmapper.

apocatarsis avatar apocatarsis commented on June 7, 2024

Well I think that when I wrote this It didnt, It was more about the lights an such, not even DPI AFAIK. But I dont have much experience, I tried to install it whitout success and just gave up when I didnt see how to change the bindings.

On the other hand, the idea was so simple that I just wrote it, just look at the code, whitout boiler palte its like 10 lines of system calls to xdotool...

However I invite you to somehow merge this with razer-cfg if you feel like it.

from naga_keypadmapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.