LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 768|回复: 2

有PS/2 3D光电鼠的驱动方法吗??

[复制链接]
发表于 2003-3-1 00:47:26 | 显示全部楼层 |阅读模式
??
发表于 2003-3-1 22:45:38 | 显示全部楼层
看看这篇文章能不能解决问题:
http://www.linuxnetmag.com/en/issue5/m5mouse1.html

An wheel at the top of the mouse offers more degrees of freedom while using the PC.
A short spin of the wheel and you are at the bottom of a document. When in a web browser, you can use it in the same way if and only if the mouse is supported by Linux.
But all mice are only distributed with M$Win drivers, aren't they?
And where do you get drivers for Linux?

You may be surprised, but Linux supports all these mice without any additional drivers as long as they obey the PS/2 standard.

The spin of the wheel creates the same signal as a fourth of fifth mouse button.
Mice with so many buttons have not been in use for a long time, so extensive information about them seems to be lacking.
We don't think that you'll find a Linux distro that supports that many buttons by default. [Mandrake 7.2 and 8.0 does - it even detected and set up our MS Optical Wheelmouse -- and possibly current Red Hat does it as well - ed.]

All you have to do is to configure the X programs and define that the fourth or fifth button (depending on the spin direction of the wheel) corresponds to the correct spin direction of the wheel.
A short setup and you could be ready. But what a surprise, Linux thinks further and the opportunities are bigger than with the distributed drivers for M$Win.
Linux drivers (if you want to call them that) do exist. They can be used in a much more flexible way than just scrolling through text.
How about a setup that the wheel would change the volume if the mouse was over xmms and would change the desktop if the mouse was over gkrellm?
No problem!
You have the freedom to set the function of the wheel, so this way you can reach undiscovered opportunities which are limited by the user's ideas. For example, with a TV card you could use the wheel to switch through all the channels. In combination with a radio mouse, you have the ideal remote control (which would cost about 100 DM). And the joy of spinning through the channels is that big that I wonder why all remote controls don't have a wheel by default.

Settings

Before we digress any more, we come back to the basic and dull installation.
First, you have to setup the X server so that the spin of the wheel is interpreted as the push of the fourth or fifth mouse button. This is not set by default as we mentioned above.
Therefore you change the XF86Config which (in general) you find at /etc/X11/ . There you change the setting in the part Pointer

File /etc/X11/XF86Config

Section "ointer"
    Protocol    "IMPS/2"
    Device      "/dev/mouse"
    ZAxisMapping    4 5
EndSection



If you installed XFree86-Version 4.0, the configuration has to look like

File /etc/X11/XF86Config

  Section "InputDevice"
      Identifier "Mouse"
      Driver     "mouse"
      Option "rotocol"        "imps/2"
      Option "Device"          "/dev/psaux"
      Option "ZAxisMapping"    "4 5"
      Option "Buttons"         "3"
  EndSection



After a restart of the X server you would be able to use the wheel if the fourth and fifth button was already preset in the X applications.
But this preset was only done by a few programs like xmms or StarOffice. For a few other programs you can add support by spending a lot of effort in changing the ~/.Xdefaults by hand.

imwheel

But it can be done much easier.
The already mentioned free button definition of the wheel can be set with the program imwheel, which you find at http://jcatki.dhs.org/ (do not be frightened by the picture you see, the page is the right one). Use the version imwhell.nogpm.
After decompression and installation of the program, you execute (as root):

>> make
>> make install

Before you call the program you should end gpm if it was running, because otherwise conflicts could appear:

>> gpm -q

(It might be that root has to do this if you did not have the proper permissions)
Then you start imwheel:

>> imwheel

and get the following output:

Output imwheel

imwheel is not checking/writing a pid file, BE CAREFUL!
An imwheel may be running already, two or more imwheel processes
on the same X display, or using gpm -W, will not operate as expected!
imwheel started (pid=1031)



A view into the list of all running processes using ps should show if imwheel was running.

Configuration

If imwheel was running you should start with the configuration of the program. A system-wide configuration can be set using the file /etc/imwheelrc. This configuration can be overwritten by every user creating a file ~/.imwheelrc .

Depending on the setting you would like to use, you edit the appropriate file.

An example could be:

~/.imwheelrc

"gkrellm"
None,                Down,        Control_L|Meta_L|Right
None,                Up,        Control_L|Meta_L|Left
#gkrellm can be placed omnipotent on every virtual desktop, thats why
#it could be used to change the desktop. (The key combination could be
#different for your window manager)

"Gimp"
Alt_L,                Up,        KP_Add
Alt_L,                Down,        minus
#If you like, you can zoom into the picture by pressing the ALT-key and
#spinning the wheel

"Terminal"
None,                Up,        Shift_R|Page_Up
None,                Down,        Shift_R|Page_Down
#The wheel is used to move up and down in a terminal

"xmms"
None,           Up,     Up,        5
None,           Down,   Down,        5
#change the volume and scroll through the play list

"kwintv"
None,                Up,        Up
None,                Down,        Down
#change channel -- wonderful!

"xedit"
None,                Up,        Up,        20
None,                Down,        Down,        20
#scroll 20 lines

"XCmail *"
None,                Up,        Up
None,                Down,        Down

"Netscape"
None,                Up,        Up,        25
None,                Down,        Down,        25
#scroll 25 lines -- nice to read

"AleVT"
None,                Up,        Right
None,                Down,        Left
#surf through the Videotex pages

"emacs"
None,                 Up, Page_Up
None,                 Down, Page_Down
#to the next page



The syntax of the configuration file has to be

"NAME OF THE PROGRAM"
PRESSED_BUTTON,       SPIN_WHEEL,        BUTTON_COMBINATION_TO_BE_EXECUTED, HOW_
MANY_TIMES
PRESSED_BUTTON,       SPIN_WHEEL_DOWN,   BUTTON_COMBINATION_TO_BE_EXECUTED, HOW_
MANY_TIMES

In the field of the name of the program, wild cards are allowed and an un-specified number of times to execute a key combination set this value to one.

But how do you get the name of a program or a window? This name does not have to be identical with the call to start it.
This "problem" is easily solved. If you spin the wheel up and down on the background of the desktop, you would get a small window:



In this window, you see a screenshot of the actual desktop. Click on this screenshot and then on the program window of which you want to know the title. The screenshot of the program appears in the imwheel window and at the top-right position the title is shown that you need in your .imwheelrc-configuration.



he button Reload at the bottom-right would reload the configuration file if you change the file while running the program.

Now you know everything to configure the wheel mouse as you desire.
发表于 2003-3-2 13:30:33 | 显示全部楼层
我的笔记本就用这样的鼠,没有什么问题。我用的是USB接口的。
用#mouseconfig来设置一下,把接口选对。
试一下,如果是三键滚轮的,就选micosoft 智能PS/2鼠。这个也试过了吧。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表