It is currently 18 Jun 2013, 21:02

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: [solved] mouse button emulation
PostPosted: 20 Oct 2005, 22:51 
Offline

Joined: 29 Sep 2005, 01:19
Posts: 19
has anyone got any tips about emulating 2nd and third mouse buttons via keyboard (and even more preferred, with a key+mouseclick combo) for a dual usb ibook?

crux-ppc 2.1rc1

i've tried the sysctrl.conf method, but X/openbox was not seeming to pick up the keypresses.. however if i run showkey at CLI, niether of the keys i mapped in sysctrl.conf produced any response (meaning that they were successfully mapped elsewhere?)

[peace]


Last edited by hackedhead on 27 Oct 2005, 17:55, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: 21 Oct 2005, 08:40 
Offline

Joined: 26 Jan 2004, 18:46
Posts: 143
Location: Italy
it has workd for you with a previous version of cruxppc?
the keycodes mapped as example into the sysctl.conf are valid for your keyboard?
probably also the kernel configuration can affect the mouse button emulation on the keyboard...

greetings


Top
 Profile  
 
 Post subject:
PostPosted: 21 Oct 2005, 13:52 
Offline

Joined: 29 Sep 2005, 01:19
Posts: 19
the keycodes are certainly valid, i can produce 125 and 96 (command and enter) with showkey.. and then after i map them with either sysctl.conf and reboot or just echo the the keycodes into the /proc/sys/dev/mac_hid/mouse_buttonX_keycode variables i no longer see output from showkey when i hit those keys (which i'm hoping means that they got mapped somewhere)

this is my first experience with crux, much less linux on ppc in general.

i'll give the kernel another twice-over.

[edit] i checked the kernel again, mouse button emulation is on, so is sysctl support, everyhting seems to be in order, and yet neither openbox or icewm respond when i use those remapped keys

i've run xev under both icewm and openbox and seen the little event tester window... it's output window shows no response at all when i use the remapped keys, and does correctly display the keycodes if they've not been mapped to mouse....

do i need to change something else? maybe something in xorg.conf?
[/edit]


Top
 Profile  
 
 Post subject:
PostPosted: 24 Oct 2005, 09:34 
Offline

Joined: 26 Jan 2004, 18:46
Posts: 143
Location: Italy
uhm... afaik in the xorg.conf file no special options should be inserted, i can only post here some rilevant informations about the kernel config:

Code:
#
# Macintosh device drivers
#
CONFIG_ADB=y
CONFIG_ADB_CUDA=y
CONFIG_ADB_PMU=y
# CONFIG_PMAC_PBOOK is not set
# CONFIG_PMAC_BACKLIGHT is not set
CONFIG_ADB_MACIO=y
CONFIG_INPUT_ADBHID=y
CONFIG_MAC_EMUMOUSEBTN=y
# CONFIG_THERM_WINDTUNNEL is not set
# CONFIG_THERM_ADT746X is not set
CONFIG_ANSLCD=y

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_TSDEV is not set
CONFIG_INPUT_EVDEV=y
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set


your mouse (xorg.conf) should be a normal 3 buttons mouse
greetings


Top
 Profile  
 
 Post subject:
PostPosted: 26 Oct 2005, 03:09 
Offline

Joined: 29 Sep 2005, 01:19
Posts: 19
well.. i went back the kernel again... i did have some extraneous values set in the "input devices drivers" area, for non-mac specific/non-adb devices.. so i've removed that in case of conflicts as per your sample config.

still no dice, nor does it work with the kernel straight off the cd...

what i've come across now that i didn't notic before is that the keycodes reported by showkey run from cli are vastly different than those reported by xev run under X. it doesn't appear to matter what i choose for "Xkbmodel" in xorg.conf either, only "xkblayout" tends to affect things (i did an experiment by switching the layout to "de" and that _definitely_ changed things, but i'm not seeing any difference between using "pc105" or "macintosh" for xkbmodel)

should the X keycodes be the same as the ones from showkey in cli, or doesn't that matter?


(to be ridiculously explicit, in an attempt to gain an understanding of how this all works):
here's a piece of the scenario:

boot into cli, run showkey
pressing fn+alt generates keycode 97
pressing alt alone generates 100

sysctl is set to map those two keycodes to buttons 2 and 3

startx, run xev

pressing fn+alt or alt produces no output from xev
(it doesn't capture any event at all)
pressing left arrow or fn+left arrow generates keycodes 97 and 100
(they dont get reported as button presses, nor do they cause button functionality)
if mouse button emulation is turned off via sysctl:
pressing fn+alt and alt generates keycodes 109 and 113 respectively


i'm not sure if the mouse button emulation keycodes in sysctl need to be those reported by showkey or by xev.. neither appears to work... and the only thing i'm left wondering is if xev and showkey should have the same output ? that maybe whatever mismatch is causing the difference there is causing the mouse emulation to misbehave as well?


any information on any of this would be appreciated

[ learning slowly.. ]


Top
 Profile  
 
 Post subject:
PostPosted: 26 Oct 2005, 09:15 
Offline

Joined: 26 Jan 2004, 18:46
Posts: 143
Location: Italy
the keycodes mapped into the sysctl.conf should be the ones displayed bye showkey and you have to use the normal pc10x keymap not the macintosh keymap

also in the xorg.conf file you should not emulate a 3 buttons mouse, your kernel already "emulate" a mouse with 3 buttons using the keyboard keys! :P

really i can't understand where is the problem in your configuration, give a look at "dmesg" after the startup to see if the kernel have problems :(

greetings


Top
 Profile  
 
 Post subject:
PostPosted: 26 Oct 2005, 19:33 
Offline

Joined: 29 Sep 2005, 01:19
Posts: 19
AHA!! finally!

the problem was in xorg.conf after all (the behavior of showkey and xev made me expect that)

the device needed to be set as "/dev/input/mice" and not explicitly as "dev/input/mouse1" which i guess was restricting it to the literal hardware and not passing the emulated mouse events, not terribly surprising, but very good to know.

[ peace ]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to: