mouse click 1

Asked by Sugi

I am trying to set one of my keys on my n52te to be mouse 1 button (the left click on a mouse). I haven't been able to find it through google or this site or the "constants.py" file. How would I do this?

Question information

Language:
English Edit question
Status:
Solved
For:
Pystromo Edit question
Assignee:
No assignee Edit question
Solved by:
Raumkraut
Solved:
Last query:
Last reply:
Revision history for this message
Raumkraut (raumkraut) said :
#1

The buttons on mice map to the codes which start with "BTN_" (as do joysticks, joypads, etc.), rather than those with "KEY_". For example, the one you're after; left mouse-button; is BTN_LEFT.

The relevant entries in constants.py begin at line #273, starting with "BTN_0". Which is not to be confused with "KEY_0"!

Revision history for this message
Sugi (fodfateofdeath) said :
#2

Awesome. That works prefectly and thank you for the fast reply. I have one more question.

I would like this key to be repeated until I press it again.

Example, I press one on my n52te and it types the letter "A" repeated until I press the one on my n52te to "turn it off". I think this is in the test.map, but I am completely lost.

Once again, thank you for the fast reply and this program "Pystromo" is simple amazing.

Revision history for this message
Best Raumkraut (raumkraut) said :
#3

For an on/off toggle, you can adapt what is mentioned in test.map in the LED-switching section, eg:
KEY_TAB: BTN_LEFT@1 . BTN_LEFT@0 .
With this, each press of KEY_TAB will cycle through the remapping blocks; delimited by the "." character. Setting a value (using "@") of 1 will 'press' a button, 0 will release.

Revision history for this message
Sugi (fodfateofdeath) said :
#4

Thanks Raumkraut, that solved my question.