New Option in the Nub Configurator?


EssoAir

Well-Known Member
Joined
Dec 13, 2012
Messages
1,822
Location
Knoxville/Seattle
Hello ED,


Would it be possible to add a new option to the Nub Configurator that maps all the directs to keys on a keyboard? I'd like it to be mapped to key codes that are not commonly used, so that they could be remapped to controlls in games that dont have native Nub support.


Here's kinda what I'm thinking


Left Nub


Up = 1003


Up+Right = 1004


Right = 1005


Right+Down = 1006


Down = 1007


Down+Left = 1008


Left = 1009


Left+Up = 1010


Right Nub would be the same, but make it like 1103, 1104, 1105, etc.


The numbers are not important, so long as they are obscure so as not to infringe on traditional key territory.


The reason for this would be so that I could finish my tutorial on mapping the android keys found here (http://boards.openpandora.org/index.php/topic/11355-tutorial-how-to-remap-android-hardware-keys/)


Thanks ED!


CJ
 
Last edited by a moderator:
That would require an update in the driver itself, I think.

Nothing I can do (I can't even code).
 
(Based on the assumption that someone who does understand these things will turn up here at some point), it would be interesting to have a mode where the nub operating a pointer control was limited to up, up+left, left, down+left etc to a total of 8 directions, so that all cursor movement was constrained to 45 degree angles.

That might make it easier to pinpoint small targets, since you could move precisely horizontal/vertically
 
Updating the nub configurator would be the easy part of the job,   all it does is select the mode.   For what you're asking (If I understand correctly) the kernel  driver that handles the nub input would need to be rewritten to offer the new modes, and we don't have many people who have the skill to do that.

- Neelix
 
Updating the nub configurator would be the easy part of the job,   all it does is select the mode.   For what you're asking (If I understand correctly) the kernel  driver that handles the nub input would need to be rewritten to offer the new modes, and we don't have many people who have the skill to do that.


- Neelix
That doesnt make any sense. We have SuperZaxxon but not the person that created it?
 
Well surely the person that wrote the Nub Configurator or the person that wrote SuperZaxxon could add this option?!?! Im no programmer, but it seems rediculous that of all the OP users none can do this
 
Well surely the person that wrote the Nub Configurator or the person that wrote SuperZaxxon could add this option?!?! Im no programmer, but it seems rediculous that of all the OP users none can do this
I think its just not possible.
 
I dare say it's possible... It's just not likely to be a priority for the few already very busy people who have the know-how to action it.

- Neelix

Edit:  Incidentally I do think it's a good idea.   I'd love to be able to use such a system to build a customised version of the mouse buttons mode with double click and middle click reversed.  I just had to point out that it's not quite as simple to implement as it might seem.
 
Last edited by a moderator:
(Based on the assumption that someone who does understand these things will turn up here at some point), it would be interesting to have a mode where the nub operating a pointer control was limited to up, up+left, left, down+left etc to a total of 8 directions, so that all cursor movement was constrained to 45 degree angles.

That might make it easier to pinpoint small targets, since you could move precisely horizontal/vertically
This is probably not so hard to implement, basically all that needs to be done for this is some extra lines of code in whatever is producing mouse movement events to "round" the nub position to the nearest 45 degree angle. Basically you take the x and y coords, compute the angle and amplitude from that, and continue with an x' and y' that correspond to the same amplitude with a rounded angle.

The original post idea of producing key events from nub events should also be possible but probably takes some more work. For compatibility with the usual arrow keys, I would define only 4 keys per nub, where diagonals correspond to two keys pressed down simultaneously. Then the code to produce the key events boils down to something like this:


void keyDown(int k) {
if (!pressed[k]) {
pressed[k] = true;
keyEvent(k,1);
}
}

void keyUp(int k) {
if (pressed[k]) {
pressed[k] = false;
keyEvent(k,0);
}
}

if (nub.x > THRESHOLD) keyDown(RIGHT); else keyUp(RIGHT);
if (nub.x < -THRESHOLD) keyDown(LEFT); else keyUp(LEFT);
if (nub.y > THRESHOLD) keyDown(DOWN); else keyUp(DOWN);
if (nub.y < -THRESHOLD) keyDown(UP); else keyUp(UP);

I don't know exactly where this code would have to be - maybe this can be done with a simple userspace daemon that just watches the nubs and produces the key events in some way, but I wouldn't know if that is possible.
 
The problem is I need the arrow keys to be reserved for the D-Pad and if you mapped both nubs to arrow leys, there would be no way to map them seperatly. I want to be able to use the nubs separately so I can map them to different things
 
The problem is I need the arrow keys to be reserved for the D-Pad and if you mapped both nubs to arrow leys, there would be no way to map them seperatly. I want to be able to use the nubs separately so I can map them to different things
Yeah yeah, I got that, so please interpret those LEFT, RIGHT, UP, DOWN constants in my pseudocode as referring to new keycodes, not the ones corresponding to the default arrow keys (dpad). I'm just saying that you don't need separate keycodes for the diagonals.
 
Oh, i thought you meant BECAUSE you could map them to arrow keys that THAT was what made it easier. Ok, cool! Thanks!

So what would be the next step to make this a reality?
 
Who made the nub configurator?
I did.

There is little the nub configurator can do for this without external support. It needs to have a driver change in the kernel.

Once support is there, the nub configurator can be modified to enable/disable it.

Another option:  have a background app or daemon listen for nub events and recreate virtual key-presses.

Not sure what's involved there.
 
Who made the nub configurator?
 
I did.


There is little the nub configurator can do for this without external support. It needs to have a driver change in the kernel.


Once support is there, the nub configurator can be modified to enable/disable it.


Another option:  have a background app or daemon listen for nub events and recreate virtual key-presses.


Not sure what's involved there.
The reason I'm interested in it, however, is the ability to use the Nubs for games in Android. Currently, its not really do-able because none of the possible nub mapping are recognizable by Android as joysticks or nubs. I was trying to get around that by mapping the nubs to keycodes and those keycodes to an Android-recognizable joystick.
 
Back
Top