Harvie / ps2dev

Arduino library to emulate PS2 keyboard/mouse
MIT License
114 stars 27 forks source link

Possible to output keyboard and mouse at the same time? (ie. y-splitter cable) #22

Open sofakng opened 2 years ago

sofakng commented 2 years ago

Can this library be used to output a PS/2 keyboard and mouse at the same time?

For example, some computers only have one PS/2 port but a y-splitter can be used to combine a PS/2 keyboard and mouse to the same PS/2 cable.

Harvie commented 2 years ago

Are they using two separate data pins or one common pin for both keyboard and mouse data? I totally agree that this is interresting topic, i don't really have time to develop it myself, but i will happily review PRs as long as they do not break existing functionality.

sofakng commented 2 years ago

I didn't do enough research before asking so I apologize, but it looks like the keyboard and mouse use separate pins:

1 = KBD DATA 2 = MOUSE DATA 3 = GND 4 = +5V 5 = KBD CLOCK 6 = MOUSE CLOCK

If I understand correctly, should be able to create two instances of the PS2DEV class and pass in the separate data and clock lines and it should "just work" ?

Harvie commented 2 years ago

If I understand correctly, should be able to create two instances of the PS2DEV class and pass in the separate data and clock lines and it should "just work" ?

Yes. But i've never tried to create two instances. It might work unless there will be some clash, eg. both instances trying to configure same timer. I don't really remember how this works. Perhaps you should try that and report :-)