Author Topic: KM switch in keyboard?  (Read 1778 times)

0 Members and 1 Guest are viewing this topic.

Offline textmode

  • Thread Starter
  • Posts: 15
KM switch in keyboard?
« on: Sat, 05 December 2020, 20:15:27 »
What I basically want to have is a (probably a bit boring?) TLK keyboard with trackpoint and "normal" keys - no flat, chicklet keys. My IBM SpaceSaver II Keyboard does that - but it also is a rubber dome and becomming less and less pleasant to type on over the years. Buying a new ready-made one sadly isn't possible as none are sold. I'll sooner or later have to build my own. So much for the background.

And if I have to build my own, I might as well add other things that might be great to have. For me, that's not backlight or something (have no use for that) - but a KVM switch without the video. As I also use a normal mouse alongside the trackpoint, it technically might be called a KMM switch (keyboard mouse mouse). I'm a bit surprised that a KM switch isn't a common addition to custom made keyboards. Sure, KVM switches can be bought easily, but they tend to come with a ton of very heavy cables and take away space (some NUCs are smaller than my current KVM switch box!). Two or three neat USB A connectors sitting innocently inside a keyboard case, with one beeing connected to the main computer and the others available for plugging into other machines...that'd be great to have!

Trouble is: My knowledge may not be sufficient to build such a thing.

My first idea was to do it all on the PS/2 level. After all the keyboard will come as a matrix to scan (nothing uncommon for the users here though I don't have experience with it yet), the trackpoint will speak ps/2, and the mouse can speak USB or ps/2. The ps/2 protocol is well documented, comprehensible and relatively easy to implement on an Arduiono. There's even a project around to turn a small AVM microcontroller into something that can switch a ps/2 keyboard between four computers. The I/O ports needed for this tend to sum up...

My plan was to let the microcontroller output ps/2 signals and to convert them to USB using the chip inside an adapter cable for protocol conversion. Sadly these adapter cables are very difficult to open without destroying the tiny chip inside. The ones I bought also turned out to be too cheap - they failed to cover the additional key found on German/ISO keyboards. Having no "<", ">" and "|" - no, won't work. Besides, those adapter calbes won't be able to handle the second mouse.

The QMK firmware often mentionned here seems to be able to handle keyboard *and* trackpoint. It also seems to be able to use V-USB if the chip doesn't have an USB port in hardware. I wonder if it can do what I would like to have? If a teensy with enough I/O ports and hardware USB is used - can QMK use both hardware USB *and* run software V-USB at the same time, thus allowing for two outputs? Or would it be better to add another smaller AVR microprocessor running V-USB for the second (and probably third) port/USB output?

And then there's USB as such: Can three devices (keyboard, trackpoint, mouse) share the same USB connection? I first thought that those ps/2-USB-adapters would create an USB hub and attach two devices to it, but it seems they can stuff both ps/2 devices into one HID device? Maybe three devices are possible as well?

There's technically also the option to just use a hardware switch that disconnects one USB port and connects the device(s) to another. Due to hotplugging that'd work. But that's not what I want as it'd cause constant connect/disconnect of the devices.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4319
  • Location: England
Re: KM switch in keyboard?
« Reply #1 on: Sun, 06 December 2020, 03:28:41 »
They make KVMs so cheap they can't do ISO?  That seems very strange though I can't say you're wrong.

A USB device can have multiple endpoints which are basically subdevices.  If you use a trackpoint with QMK it will have two of these - keyboard and mouse.  If you could find a KVM that supported multiple endpoints that could be the 'keyboard' and the external mouse the mouse and you're done.

Could you 'stuff' three PS/2 into one USB?  Yes, definitely.  Keyboards and mice don't use much data compared to a USB memory stick.  But as you say this doesn't really help because you can't switch USB at hardware level instantly and you'd need to find a KV switch that supported multiple endpoints anyway so may as well plug both devices into that.

I do wonder how/if Hasu's USB-USB converter handles hotplugging and multiple endpoints - maybe you could switch the computer side of a USB switch between two Hasu's, one connected to each computer?
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline textmode

  • Thread Starter
  • Posts: 15
Re: KM switch in keyboard?
« Reply #2 on: Sun, 06 December 2020, 05:35:34 »
Quote from: suicidal_orange
They make KVMs so cheap they can't do ISO?  That seems very strange though I can't say you're wrong.
Yes, sadly. I got the adapters for free after I complained to the seller. But that doesn't help much - I see no way to fix those, not even with complete control on the ps/2 input side. They're called "13ba:0017 PCPlay PS/2 Keyboard+Mouse Adapter" and just ignore that one key. Another adapter - called "0a81:0205 Chesen Electronics Corp. PS/2 Keyboard+Mouse Adapter" - works fine and supports all keys.

Quote from: suicidal_orange
A USB device can have multiple endpoints which are basically subdevices.  If you use a trackpoint with QMK it will have two of these - keyboard and mouse.
Thanks! That wasn't obvious to me from the documentation regarding USB. It seems to be a very complex theme. "endpoints" where mentionned in V-USB, but I wasn't sure what was meant by that. Some other documentation also mentionned that keyboards come with two endpoints - one for the keys pressed and one for the status LED information sent back from the computer. But lsusb only shows one endpoint for the mouse and one for the keyboard when connected via an adapter cable, and I have no true USB keyboard for testing. Perhaps the adapter does something more there.

Quote from: suicidal_orange
If you could find a KVM that supported multiple endpoints that could be the 'keyboard' and the external mouse the mouse and you're done.
Not quite. There's still the annoyance that KVM switches are pretty big. Those switching V as well have to - video has a lot of pins. Some devices may be a bit smaller, but it's still quite a lot of cables hanging around.

Quote from: suicidal_orange
Could you 'stuff' three PS/2 into one USB?  Yes, definitely.
That sounds excellent!

Quote from: suicidal_orange
But as you say this doesn't really help because you can't switch USB at hardware level instantly and you'd need to find a KV switch that supported multiple endpoints anyway so may as well plug both devices into that.
I'm not even entirely sure that my existing KVM switch preserves state. There's no indication of disconnection, but after switching to another computer, num lock is activated. Which is a big annoyance as my keyboard, beeing TKL, still has a number block integrated on a layer above uio/jkl/m,. leading to quite unexpected results when pressing keys after switching. Caps lock and scroll lock are also activated.

Quote from: suicidal_orange
I do wonder how/if Hasu's USB-USB converter handles hotplugging and multiple endpoints - maybe you could switch the computer side of a USB switch between two Hasu's, one connected to each computer?
My understanding of the converters here is still quite limited. But if I got that right quite a lot of the complexity of Hasu's converter arises from having to "understand" an USB keyboard plugged into it and having to act as USB host for the keyboard. The converter then acts upon those signals read from USB and outputs them to USB. I'd expect it to disconnect the device on its output side if the one on the input side got disconnected.

The ps/2 protocol is way easier to handle. Apart from initialization and such, the device (keyboard or mouse) only sends a signal when it has some news - that is, a key was pressed or released or the mouse moved. The protocol is also relatively easy because it supports only keyboard and mice.

I've found an approach (not implemented yet?) where there's one Atmel AVR running V-USB for each output/connected computer plus another AVR for handling the actual signal(s) to be switched.

Switching between two computers might even work with two AVRs. They could run V-USB and each take care of one ps/2 device each (one trackpoint, one mouse, plus talking to each other). There might even be enough I/O ports for splitting the scanning of the keyboard matrix between them. But...two AVRs with diffrent code? And: How many can an USB port drive if there're the devices themshelves to power as well? I don't have any experience with V-USB either yet. Might be worthwile exploring more.

Another way might be to take a QMK driven teensy and attach a small AVR running V-USB for the second port. In theory, QMK has already everything that's needed, but not necessarily usable in combination: It can read ps/2 (trackpoints) - but I'd need a second ps/2 input for the second mouse. Perhaps doable (fast enough? Enough interrupts or whatever it takes?). It can read the keyboard matrix and the ps/2 trackpoint and output that as an USB signal (seen in some projects introduced here) and it claims to support V-USB on microcontrollers without USB hardware support. But can it use both at the same time? I'm sure that's doable somehow, but that doesn't mean that QMK is in any way prepared for that. The changes to the code that this might require may be massive.

Offline nevin

  • Posts: 1363
  • Location: US
Re: KM switch in keyboard?
« Reply #3 on: Sun, 06 December 2020, 15:07:04 »
are you planning on writing the code? if not, don't make things difficult.

- find a kvm that works well with your setup. some go "dumb" when switching with some systems.
- pull the kvm apart, desolder most or all of the connectors (maybe keeping the mouse input if you don't relocate that port in your keyboard housing)
- use wires instead of connectors to connect the keyboards usb/ps2 to the kvm pcb's keyboard input.
- connect the mouse to the kvm pcb (either using the original onboard port or remove connector on kvm pcb and relocate it somewhere more convenient in the keyboard case)
- you'd still have 2 sets of mouse & keyboard wires coming out of the back of the keyboard, but that would accomplish the goal of getting the kvm into the keyboard.

** yes, most cheap kvm's use big heavy "squid" connectors/cables off the back of the kvm, but they are just combining all the connections into one connector. use a multimeter to do a continuity test to figure out what pin is what on the 2 large connectors on the back of the kvm, then you can put smaller connectors in the case either using the same "squid wiring" (one connector on one end, keyboard & mouse connectors on the other) or 4 individual connectors on the back 2 for each system.

if you're building your board from scratch, you could replace the switching buttons on the kvm as dedicated switches on your keyboard. say that block above the arrows...
- if you're having issues with debounce on those switches, you may have to make a debounce circuit for those two switches (if the kvm is getting chatter/bouncing from regular switches instead of those tiny buttons on the kvm pcb.

some people have included usb hubs in the keyboards they've built (using same principle)

or you could put a hole computer inside your keyboard, like this guy did

if anything, i'd probably build a kvm/audio control panel that would stay on the desk with a good bit of weight so it doesn't shift around. that way you would only have two wires for keyboard & mouse exposed and headphone/aux ports right on top of your desk.

either that or look into bluetooth devices and bt switching.... is there a bluetooth kvm?
« Last Edit: Sun, 06 December 2020, 15:15:08 by nevin »
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline Findecanor

  • Posts: 4784
  • Location: Koriko
Re: KM switch in keyboard?
« Reply #4 on: Sun, 06 December 2020, 15:50:41 »
BTW, there are also pure-software KM switches such as Synergy. I think the current version is closed-source, but there are several forks of it from when it was open source.

I think many KM/KVM switches that do USB are quite limited in what kind of USB they can talk. Input ports are often dedicated to one keyboard port and mouse port, or a pair of "HID" (either), and many don't work with NKRO or mouse-keys and such. That is because the "switch" isn't really a switch but a host to the peripherals and multiple peripherals to the hosts.

either that or look into bluetooth devices and bt switching.... is there a bluetooth kvm?
Logitech has its proprietary "Logitech Flow" protocol which makes both mouse and keyboard swap between hosts, all at once.
But I think there should be an open, free protocol over BLE that could do the same thing... If DIY BLE mice ever becomes a thing.

But maybe you're really thinking of a USB-device-to-BT bridge, that change host with one key press?
Handheld Scientific has a USB-to-BT adaptor, but it has only one input.
Man must shape his tools lest they shape him
-- Arthur Miller

Offline textmode

  • Thread Starter
  • Posts: 15
Re: KM switch in keyboard?
« Reply #5 on: Sun, 06 December 2020, 18:44:30 »
Quote from: nevin
are you planning on writing the code? if not, don't make things difficult.
Perhaps. At least in part. I'm more familiar with software development than with hardware assembling/modifications or electronics. Talking to ps/2 devices intrests me.

Quote from: nevin
- find a kvm that works well with your setup. some go "dumb" when switching with some systems.
The one I currently use sadly isn't that great. Switching to the other machine involves stretching over to where the KVM stands, pushing a button (ok), hearing a beep sound (argh!), seeing an LED switch on the KVM (ok), and then returning to the keyboard, having to discover that the keyboard state is in disarray (argh - num lock activated and so on). It is such a hassle that I often use a second keyboard or ssh instead. The KVM switch wasn't even cheap.

Quote from: nevin
- you'd still have 2 sets of mouse & keyboard wires coming out of the back of the keyboard, but that would accomplish the goal of getting the kvm into the keyboard.
Hm. I did a bit more research regarding USB KM switches and found out that the most simple and common ones are in essence USB hubs and could be emulated if you'd plug keyboard and mice into a standard USB hub and then unplug it from computer A and plug the USB hub manually into computer B. The button for toggling between the outputs handles the unplugging/plugging. Seems to work very similar to the old physical switches. I remember once having opened the case of an old serial port switch. It had quite an impressive mechanical switch and a lot of wires inside :-)

That simple approach sadly won't help me much. Each computer has to discover the USB devices anew after each press of the button, and there's no way to switch on a keypress because the KVM has absolutely no idea what kind of devices it switches. But at least it would be no problem to connect a keyboard and two mice.

The next step seems to be a generic keyboard and mouse emulation inside a chip in the KVM. The KVM emulates keyboard and mouse for each computer and can switch between them with a keypress on the keyboard or some mouse interaction. This is said to work for standard keyboards and mice but not for those requiring extra drivers. Might be good enough for my purpose - except that I doubt that those KVM switches can handle two mice at once.

The most advanced technology seems to be true transparent USB emulation - which is said to be able to handle mice and keyboard which require special drivers. Intresting, but perhaps a bit of overkill.

Quote from: nevin
if you're building your board from scratch, you could replace the switching buttons on the kvm as dedicated switches on your keyboard. say that block above the arrows...
I'd like to switch between computers with a hotkey or key combination. Whatever software does the switching has to be able to read the data stream anyway (for the emulation on the currently disconnected port) and can get its information from there.

Quote from: nevin
- if you're having issues with debounce on those switches, you may have to make a debounce circuit for those two switches (if the kvm is getting chatter/bouncing from regular switches instead of those tiny buttons on the kvm pcb.
Handling bouncing keys is certainly an intresting topic, and I'll have to do it software side for the regular keys of the keyboard if I can't use or adjust existing software like QMK.

Quote from: nevin
or you could put a hole computer inside your keyboard, like this guy did
That's something I'd love to do eventually as well :-) But more for a keyboard for carrying around with me. Might be obligatory to insert a Pi into these I'm afraid :-)

Quote from: nevin
if anything, i'd probably build a kvm/audio control panel that would stay on the desk with a good bit of weight so it doesn't shift around. that way you would only have two wires for keyboard & mouse exposed and headphone/aux ports right on top of your desk.
Havn't thought about audio yet. But..that may not require any switching at all. If I'm watching a film, I don't want it to be interrupted when wanting to type something on the other machine. Weight...yes, that could help against the lightweight switch beeing pushed around by the much heavier cables. I'd still prefer to have that inside the keyboard, switching between two relatively lightweight USB cables.

Quote from: nevin
either that or look into bluetooth devices and bt switching.... is there a bluetooth kvm?
Probably exists somewhere. But I don't want to use bluetooth even if a computer supports it.

Quote from: Findecanor
BTW, there are also pure-software KM switches such as Synergy. I think the current version is closed-source, but there are several forks of it from when it was open source.
Oh? Last time I used it it was AFAIK open source. Worked quite well - but there are limits: The other machine needs to have finished booting and it needs to be accessible over the network. While that will be given most of the time, it won't always be guaranteed, especially when I want to have the second port for connecting diffrent computers at diffrent times. Other than that, synergy is great, yes.

Quote from: Findecanor
Input ports are often dedicated to one keyboard port and mouse port, or a pair of "HID" (either), and many don't work with NKRO or mouse-keys and such. That is because the "switch" isn't really a switch but a host to the peripherals and multiple peripherals to the hosts.
That might be the diffrence between those KVM switches that emulate "standard" keyboard/mice and those that are the most advanced and emulate all. Still, as you pointed out, getting a second mouse accross might be something the KVM's designers didn't expect and didn't handle.

But at least standard functionality of a TLK keyboard ought to work? And of a scrollwheel mouse? The trackpoint may be more tricky...though if it talks ps/2, there isn't that much room for extended functionality.

I'd still prefer to have the switching between host computers beeing done on a more comprehensible level (like ps/2). There's even existing software for running a keyboard switch on a relatively small AVR. Said AVR doesn't have enough ports to handle the mouse as well, but that might be adjustable. My original plan was to use such a switch and to convert it all to USB for each host with a (working) ps/2 to USB adapter.
« Last Edit: Sun, 06 December 2020, 18:48:30 by textmode »

Offline nevin

  • Posts: 1363
  • Location: US
Re: KM switch in keyboard?
« Reply #6 on: Sun, 06 December 2020, 22:24:56 »
Quote
if you're building your board from scratch, you could replace the switching buttons on the kvm as dedicated switches on your keyboard. say that block above the arrows...
----
I'd like to switch between computers with a hotkey or key combination. Whatever software does the switching has to be able to read the data stream anyway (for the emulation on the currently disconnected port) and can get its information from there.

i meant changing the little tact buttons on the kvm pcb to actual switches (would not be part of the matrix) though they would be regular switches & keycaps and look like part of the regular keyboard.

the trackpoint is part of the keyboard, not a separate mouse. modules are usually connected via i2c to the keyboards micro controller.
the trackpoint module may be ps/2, but the controller is just reading the output from the module and including it in it's usb reporting. (afaik). you could use regular mouse keys instead of trackpoint. though, i believe those keycodes can be stripped off in some kvms.

https://beta.docs.qmk.fm/using-qmk/advanced-keycodes/feature_mouse_keys
https://beta.docs.qmk.fm/using-qmk/software-features/feature_pointing_device
https://beta.docs.qmk.fm/using-qmk/hardware-features/feature_ps2_mouse

here's some custom boards with trackpoints to look into
https://www.tex-design.com.tw/us-en/products.php?cid=17
https://ultimatehackingkeyboard.com/
https://promethium.keyboard.id/
- https://priyadi.smugmug.com/Mechanical-Keyboard/Promethium-Keyboard/Build-Log/n-4fFNQC/
- https://github.com/qmk/qmk_firmware/tree/master/keyboards/handwired/promethium
- https://github.com/gzeronet/teensy-trackpoint-tmk-keyboard

i'd say a good starting point would be getting/making a qmk based keyboard of your choice (could even be a simple macropad) and see how/what it's reporting and what features work & what doesn't with the kvm's you have on hand.
- try mouse keys
- try a trackpoint or other pointing device
- see how the kvm reacts to qmk

then see what kind of alternate kvm you can cook up.

there's also a qmk based trackball and a qmk based mouse. both based around the PMW3360 optical sensor.
check out ploopy   https://www.ploopy.co/
https://github.com/ploopyco

your project looks like an awful steep climb....
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline textmode

  • Thread Starter
  • Posts: 15
Re: KM switch in keyboard?
« Reply #7 on: Mon, 07 December 2020, 14:58:33 »
Quote from: nevin
i meant changing the little tact buttons on the kvm pcb to actual switches (would not be part of the matrix) though they would be regular switches & keycaps and look like part of the regular keyboard.
Ah, I see. The idea to have better buttons - perhaps a dedicated one - for the switching operation sounds good. If I have to build my own keyboard in the end it might be a good idea to include such a key. In order to avoid having to debounce it, I might include it into the matrix instead of using an existing key combination.

Quote from: nevin
the trackpoint is part of the keyboard, not a separate mouse.
On the physical level, that's correct - the trackpoint doesn't look like a mouse, and it's screwed into the keyboard. But on the relevant electronic/protocol level, according to the information I was able to locate about trackpoints (version IV - earlier ones are diffrent), they're ps/2 mice. The controller (i.e. a teensy running QMK) cannot even distinguish if what is connected to it is a "normal" ps/2 mouse or a trackpoint. It can only figure out if it's a simple 2-button-mouse or if it supports scrollwheel and up to 5 buttons as well. Perhaps there's some additional protocol placed on top of ps/2 for calibration, but...that doesn't seem likely as the trackpoint has no further function and people having included one in their keyboards didn't complain about missing functionality.

Quote from: nevin
modules are usually connected via i2c to the keyboards micro controller.
i2c is certainly useful and most likely used in many computer/microcontroller environments, and it might come into play if two microcontrollers need to talk to each other (i.e. when I need a second one for a second USB port), but in the end it's just another bus/protocol - just like ps/2 or USB are - a clock and a data line, and devices communicate using those. The trackpoints of intrest either have no control logic at all (the older ones) or are ps/2 mice.

Quote from: nevin
the trackpoint module may be ps/2, but the controller is just reading the output from the module and including it in it's usb reporting. (afaik).
In the end, yes. "Just" seems a bit simplifying in this case. The controller needs to talk to the ps/2 device as a host, initialize the device, process the information gained to some degree, talk to the other "side" (usb) and send the information there.

Quote from: nevin
you could use regular mouse keys instead of trackpoint. though, i believe those keycodes can be stripped off in some kvms.
Using mouse keys on the keyboard definitely sounds intresting. I tried to implement them when experimenting with a software side filter (make caps lock toggle to a new layer and use hjkl cursor keys), but the mouse keys didn't work there yet. Maybe I failed to do some initialization. The keyboard used for tests was a ps/2 keyboard connected through an adapter directly to an USB port.

Quote from: nevin
https://beta.docs.qmk.fm/using-qmk/advanced-keycodes/feature_mouse_keys
https://beta.docs.qmk.fm/using-qmk/software-features/feature_pointing_device
https://beta.docs.qmk.fm/using-qmk/hardware-features/feature_ps2_mouse
Thank you for those links. I somehow ended up with the wrong adress when I first looked.

The (for me) relevant part seems to be located in tmk_core/protocol/, and there in particular the files regarding ps2 and usb. In theory that is all that is needed. Of course qmk/tmk is not prepared to handle a second mouse. It is only prepared to talk to one mouse which can be connected using diffrent features of the microcontroller (UART, interrupt, busywait). Talking to a second mouse will require code changes. And then that information gained about movements of the second mouse needs to be passed on to the USB host. suicidal_orange confirmed already that one USB device can include two mice, so that ought in theory to be possible.

V-USB also sits in that folder but most likely won't be usable directly alongside hardware USB. QMK/TMK have been developped for one USB device at a time, not two. I'm not sure if both can be made usable simultaneously. And even if they can: Microcontrollers don't have infinite ressources. While the I/O-pins are plentiful at i.e. a teensy, it still doesn't seem to have more than one UART or one USB. The amount of interrupts is also limited.

Quote from: nevin
https://www.tex-design.com.tw/us-en/products.php?cid=17
Yes, the Tex Yoda is very close to what I'd like to have, but lacking so many keys. With shipping and tax, it may end up costing close to 400 euro. For that it'd have to be perfect...

Quote from: nevin
https://ultimatehackingkeyboard.com/
Thanks! I've seen that as well. It's definitely an intresting concept. I'm just not looking for a split keyboard.

Quote from: nevin
https://promethium.keyboard.id/
Looks like another split keyboard with very few keys. I'm not ready for that yet I'm afraid.

Quote from: nevin
- https://github.com/gzeronet/teensy-trackpoint-tmk-keyboard
Yes, that's more like it, although it's small like the tex yoda. There's also this version that looks pretty intresting. Perhaps for a keyboard to carry around? But then it'd want to have a Pi inside as well.

Quote from: nevin
i'd say a good starting point would be getting/making a qmk based keyboard of your choice (could even be a simple macropad) and see how/what it's reporting and what features work & what doesn't with the kvm's you have on hand.
- try mouse keys
- try a trackpoint or other pointing device
- see how the kvm reacts to qmk
That's very good advice, thank you! Experimenting with mouse keys might be easiest as that can be done in software (I hope). A thinkpad keyboard with trackpoint is on its way to me. When that one arrives, I can at least try to talk to it via arduino and ps/2 (just need to gather enough courage to remove the trackpoint from the poor still working keyboard..).

Another intresting step might be to experiment with V-USB. QMK/TMK makes use of that one as well if there isn't hardware USB support. Connecting a single ps/2 device and converting it to USB (like what the cheap converters do) might be helpful in learning. For my purposes, I'd have to input 3 ps/2 devices (keyboard, mouse, mouse) and use V-USB at the same time...might be too much for a small microcontroller (not enough interrupts?).

Quote from: nevin
there's also a qmk based trackball and a qmk based mouse. both based around the PMW3360 optical sensor.
That also sounds intresting. But what does a trackball need QMK for? AFAIK trackballs are mostly inverted mice? Experimenting with one and seeing how well I get along might also be of intrest in general.

Quote from: nevin
your project looks like an awful steep climb....
Yes, I'm afraid so...but that's what I'd really love to have :-)
« Last Edit: Mon, 07 December 2020, 15:01:21 by textmode »

Offline nevin

  • Posts: 1363
  • Location: US
Re: KM switch in keyboard?
« Reply #8 on: Mon, 07 December 2020, 15:30:37 »
Quote
That also sounds intresting. But what does a trackball need QMK for? AFAIK trackballs are mostly inverted mice? Experimenting with one and seeing how well I get along might also be of intrest in general.

the sensor information has already been ported to qmk. so it's a mouse or trackball that runs qmk.

if you are looking at any mouse to integrate, i'd start here, as qmk already "understands" what's going on....
it also looks like they are working on integrating a mouse to the keyboard via a trrs connector via i2c (reddit link)
...if you're looking to integrate all 3 devices (mouse, tackpoint, keyboard)

you could probably get away with mouse/keyboard & "mouse keys" on one device.

or you could integrate a usb hub, then it wouldn't matter which pointing device you were using.

....but all this changes when you put it through the limitations of most kvm's
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline textmode

  • Thread Starter
  • Posts: 15
Re: KM switch in keyboard?
« Reply #9 on: Mon, 07 December 2020, 16:40:50 »
Quote from: nevit
if you are looking at any mouse to integrate, i'd start here, as qmk already "understands" what's going on....
it also looks like they are working on integrating a mouse to the keyboard via a trrs connector via i2c (reddit link)
Ahh. Now I see why you mentionned i2c. The sensor of that trackball mouse may use that protocol to talk to other chips (like the teensy that runs qmk/tmk).

You can think of ps/2 as a specialized form of i2c that's been used solely for mice and keyboards in the past (it's an abstraction but close enough). QMK/TMK speaks it as well of course. But it can only talk to one ps/2 device at a time (because nobody saw need to use two mice so far).

Quote from: nevit
if you're looking to integrate all 3 devices (mouse, tackpoint, keyboard)
Got an idea: Perhaps there's a simpler way to integrate the second mouse. After all they're very similar - both use the intellimouse extension (middle button + trackpoint up/down scrolls). Scaling and the like are likely the same as well. I'll have to check that, but if it turns out to be true, I might at least "merge" trackpoint and mouse into one device. I'd still have to initialize the second mouse in qmk/tmk, but after all is set up, it simply doesn't matter which of the mice (trackpoint or mouse) sends a movement package - they'll be in the same format and may be forwarded to the usb mouse as if they originated from the same device.

Quote from: nevit
or you could integrate a usb hub, then it wouldn't matter which pointing device you were using.
True. But then I'd either have to deal with the whole unwanted disconnection/reconnection when switching to another computer or have to trust the KVM switch manufacturer to be able to emulate *two* mice. Based on how complex things get on the USB side, I don't have much hope for that.

Quote from: nevit
....but all this changes when you put it through the limitations of most kvm's
Yes, probably. And they're so bulky. And beep! :-(

My hope is to be able to do most on the qmk/tmk side and just "attach" a small AVR running V-USB for the second port. The teensy running qmk/tmk could tell the smaller AVR which signals are awaiting sending and stop sending to USB when the smaller one has been choosen. Still complicated...keeping it all to ps/2 and convert that might be easier.