Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is mouse wheel supported? #15

Open
FreezingEye opened this issue Jun 18, 2021 · 4 comments
Open

Is mouse wheel supported? #15

FreezingEye opened this issue Jun 18, 2021 · 4 comments

Comments

@FreezingEye
Copy link

Is mouse wheel supported?

@Harvie
Copy link
Owner

Harvie commented Jun 18, 2021

I had only worked with keyboard. Mouse example was contributed by @liumazi some time ago.
I am 100% sure that mouse wheel can be done, but i think it might need some extra coding.

Idealy it would be vital to modify ps2dev library to have mouse_init() and mouse_handle() methods similar to keyboard counterparts. Originaly ps2dev contained only low-level code which was annoying to use (raw sending and receiving bytes over ps2). So i've created the init/handle/mkbrk methods to make everything bit easier to use. But so far we don't have this kind of high level code for mouse.

Eg.: right now you can emulate mouse wheel using low level api of ps2dev library, but once you write the high-level code for mouse wheel on top of ps2dev it would make sense to integrate it directly to ps2dev, so it can be used by other people.

Also i wonder if it would be possible for single device to be used as both mouse and keyboard at the same time (using single ps2 port). That would affect the design decisions, because it would make sense to have single handle() method common for both mouse and keyboard.

@FreezingEye
Copy link
Author

emm..I think liumazi is not activing in github this year.But his/her code is interesting.I try to check it out.

@chuchana
Copy link

i wonder if it would be possible for single device to be used as both mouse and keyboard at the same time (using single ps2 port).

It does seem possible, but it might not be widely supported:

Keyboard and mouse ports may be combined into a single port which can be used to connect both by splitter cable. [wikipedia: PS/2 port (note a)]

a given system's keyboard and mouse port may not be interchangeable since the two devices use different sets of commands and the device drivers generally are hard-coded to communicate with each device at the address of the port that is conventionally assigned to that device.
[wikipedia: PS/2 port]

@liumazi
Copy link
Contributor

liumazi commented Mar 14, 2022

emm..I think liumazi is not activing in github this year.But his/her code is interesting.I try to check it out.

The PS/2 Mouse Interface - https://blog.csdn.net/Augusdi/article/details/7288556

The host then issues the "Get device ID" command (0xF2) and waits for a response. If a standard PS/2 mouse (ie, non-Intellimouse) is attached, it will respond with a device ID of 0x00. In this case, the host will recognize the fact that the mouse does have a scrolling wheel and will continue to treat it as a standard PS/2 mouse. However, if a Microsoft Intellimouse is attached, it will respond with an ID of 0x03. This tells the host that the attached pointing device has a scrolling wheel and the host will then expect the mouse to use the following 4-byte movement data packet: ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants