Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mouse button emulation
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
shuuhen
n00b
n00b


Joined: 12 Feb 2005
Posts: 49

PostPosted: Mon Jan 02, 2006 11:04 pm    Post subject: Mouse button emulation Reply with quote

After searching for a while, I noticed most of the issues with getting mouse button emulation working were fixed by adding CONFIG_SYSCTL=y to the kernel config. I do have sysctl enabled and I have support for everything except Windtunnel G4 thermal management in Macintosh drivers. I have read the FAQ and configured mouse button emulation according to that in /etc/sysctl.conf.

I also read that pbbuttonsd is needed. It is installed and added to the default runlevel. I'm running a 2.6.12-r6 kernel.

Anyone else having problems with mouse button emulation in 2.6 kernels? Any solutions to try?
Back to top
View user's profile Send private message
Frelon
Tux's lil' helper
Tux's lil' helper


Joined: 10 Oct 2004
Posts: 149
Location: France

PostPosted: Tue Jan 03, 2006 8:23 pm    Post subject: Reply with quote

Just a few questions :

What is your hardware (laptop ?? etc..) ?
Which mouse are you trying to use ?

In the kernel, you have to compile 2/3 buttons emulations. It is also possible to bind "right clic" with function key.
_________________
http://stan.openmod.org
Back to top
View user's profile Send private message
Kvetch
Guru
Guru


Joined: 29 Apr 2004
Posts: 318
Location: /dev/null, VA

PostPosted: Tue Jan 03, 2006 8:33 pm    Post subject: Reply with quote

I have basically the same question. I have a G4 ibook with the one button trackpad.
If your kernel is configured for 2/3 button emulation how do you configure a function key for it?

Thanks,
Nick
Back to top
View user's profile Send private message
Frelon
Tux's lil' helper
Tux's lil' helper


Joined: 10 Oct 2004
Posts: 149
Location: France

PostPosted: Tue Jan 03, 2006 8:51 pm    Post subject: Reply with quote

Highlight from http://www.alessandroronchi.net/wiki/LinuxOnIBookG4 :
Quote:


Make the Apple key works as Altgr and the keyboard more linux confortable

My Apple G4 12" doesn't have any Altgr Key, so it's impossibile to write composed symbols as @ or #. To correct this problem, you can do this procedure on Gnome:

1. Computer -> Desktop Preferences -> Keyboard
2. "Layout Options" tab
3. In the right-hand list open the "Third level choosers" group
4. Highlight "Press Left Win-key to choose 3rd level"
5. Click "Add"

Or add this to keyboard section on /etc/X11/xorg.conf file:

"XkbOptions" "lv3:lwin_switch"



My xorg.conf file keyboard section is:

Section "InputDevice"
Identifier "Keyboard0"
Driver "keyboard"
Option "XkbKeycodes" "macintosh"
Option "XkbSymbols" "macintosh/us"
Option "XkbGeometry" "macintosh"
Option "XkbOptions" "ctrl:nocaps, lv3:lwin_switch"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc105"
Option "LeftAlt" "Meta"
Option "RightAlt" "LWin"
Option "XkbLayout" "it"
EndSection



On the US keyboard, the ~ and +/- keys aren't mapped correctly.
add these lines to a startup script:

xmodmap -e "keycode 49 = section plusminus"
xmodmap -e "keycode 94 = quoteleft asciitilde"



Three Button Mouse Emulation
I usually use an external USB three button mouse, but I want to have an alternative access to the middle and right button without the external mouse.
To use an alternative key to emulate the mouse buttons, you must do:

echo "1" > /proc/sys/dev/mac_hid/mouse_button_emulation



The standard keys now are on Fn+CTRL for middle button and Fn+alt for right button.
If you want to change the keys, you must do:

echo "68" > /proc/sys/dev/mac_hid/mouse_button2_keycode
echo "87" > /proc/sys/dev/mac_hid/mouse_button3_keycode



Remember, you must do these commands every boot, so you can add to an init script.

You can change the keycodes 68 and 87 writing your own. To view what keycode is a button press you can use:

xev



If your distro supports /etc/sysctl.conf, you can add these lines to this file:

# Mouse button emulation:
dev/mac_hid/mouse_button_emulation = 1
#dev/mac_hid/mouse_button2_keycode = 68
#dev/mac_hid/mouse_button3_keycode = 87



Uncomment the last lines if you want to edit the keycodes.


_________________
http://stan.openmod.org
Back to top
View user's profile Send private message
shuuhen
n00b
n00b


Joined: 12 Feb 2005
Posts: 49

PostPosted: Tue Jan 03, 2006 8:54 pm    Post subject: Reply with quote

I'm using a PowerBook 3400. Just using the trackpad with it, but would it matter? The mouse and keyboard are two separate devices.

I do have support for 2/3 button emulation in my kernel. After adding the right configuration to sysctl.conf and running 'sysctl -p' in the terminal, the buttons stop working for any function. I tried using F7 and F8, but all that it did was stop me from switching from a VT back to X. I don't even get a response from the keys I have it configured mouse button emulation to use.
Back to top
View user's profile Send private message
shuuhen
n00b
n00b


Joined: 12 Feb 2005
Posts: 49

PostPosted: Mon Jan 09, 2006 3:35 am    Post subject: Reply with quote

Still haven´t figured out the issue with the mouse button emulation. Anyone have it working on their computer? If so, what kernel are you using? Please include the mouse and keyboard sections from your xorg.conf file. Would anything else be relevant (other than the 3 lines in sysctl.conf)?
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Mon Jan 09, 2006 5:52 am    Post subject: Reply with quote

It works fine here. I'm using the default xorg.conf settings from Xorgautoconfig, and no, nothing else should be relevant, just make sure you have sysctl support in your kernel and the ADB 2+3 mouse button emulation. Make sure that the sysctl settings are being set in /proc/sys/dev/mac_hid (you can check by cat'ing the files in that directory). Finally, make sure that the keycodes for the keyboard buttons you're setting are the ones that are produced by showkey on the console, not the ones produced by xev in X. (Some are different)
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
shuuhen
n00b
n00b


Joined: 12 Feb 2005
Posts: 49

PostPosted: Mon Jan 09, 2006 8:05 am    Post subject: Reply with quote

I checked all of that, but still no go. The keys I have it configured to use stop any functionallity at all after they are set. I don´t even get output when I press the keys in showkey. I´m thinking about trying a newer kernel to see if anything improves. Unfortunately I can´t try it until closer to the end of the week (I have things I need my computer for and it compiles slowly). What kernel are you running?

Right now I´m using the 2.6.12-gentoo-r6 kernel. I have had success before when using a 2.4 kernel on a different distro, but I will avoid going back like the plague.
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Mon Jan 09, 2006 1:55 pm    Post subject: Reply with quote

This has worked with every 2.6 kernel I've tried. What kind of Mac do you have and which keys are you trying to set?
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
shuuhen
n00b
n00b


Joined: 12 Feb 2005
Posts: 49

PostPosted: Tue Jan 10, 2006 4:25 am    Post subject: Reply with quote

I´m using a PowerBook 3400 (OldWorld, so I have to use BootX). I´ve tried to use F7, F8, F11, F12, command and keypad enter.
Back to top
View user's profile Send private message
cdooley235
n00b
n00b


Joined: 31 May 2004
Posts: 6
Location: Boston

PostPosted: Mon Feb 13, 2006 2:00 am    Post subject: Reply with quote

I'm having a similar issue on my G3 pismo. I have the proper options in the 2.6.15-gentoo-r1 kernel that i'm using, and cat'ing the appropiate places in /proc show that the sysctl have loaded properly. I notice too that the F10 and F12 buttons that I have loaded to emulation the 2nd and 3rd buttons respectively don't give any action.

I did make one observation that perhaps might be useful; though i've not figured it out where to go with it yet. In X, my mouse is /dev/input/mouse1 (the touchpad on the powerbook). When I cat /dev/input/mouse1, and hit F10 or F12, nothing of couse happens but of course the touchpad button does generate output. However, when i cat /dev/input/mouse0... both of these buttons give a response!

So perhaps they are being emulated to the wrong mouse? Is there a way to have two active mice in X? Or is there a way to direct which mouse device the sysctl assignes the emulation to?

Hope this observation isn't completely off the mark and helps get this post solved.

[EDIT]

I just edited my xorg.conf file with this line in the server layout along with the other input device options, as well as set up a second input device for /dev/input/mouse0 and the emulation started to work:

# add this to ServerLayout section
InputDevice "mouse2" "SendCoreEvents"

# Add this input device:
Section "InputDevice"
Identifier "Mouse2"
Driver "mouse"
Option "Device" "/dev/input/mouse0"
EndSection

Hopefully this will work for you too.

Cheers.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum