geekhack

geekhack Projects => Making Stuff Together! => Topic started by: Dwarlorf on Thu, 13 October 2016, 09:15:50

Title: Analog Thumbstick instead of arrows?
Post by: Dwarlorf on Thu, 13 October 2016, 09:15:50
I hope this is the right topic to put this in. My other option was the 'Input Devices' board.

I figured using 1 thumbstick instead of 4 arrow keys would save some serious space on small keyboards. But I don't know this is technically possible. Does anyone know if its possible to connect an analog or electrical thumbstick to a Teensy and to program it in TMK/QMK? A PSP thumbstick for instance or maybe this one: https://www.adafruit.com/product/512
Title: Re: Analog Thumbstick instead of arrows?
Post by: AMongoose on Thu, 13 October 2016, 10:36:10
But why would you want that?

Adding an analog stick might be a good idea, but its not a suitable replacement for the arrow keys imo.
Title: Re: Analog Thumbstick instead of arrows?
Post by: Dwarlorf on Thu, 13 October 2016, 12:32:01
But why would you want that?

Adding an analog stick might be a good idea, but its not a suitable replacement for the arrow keys imo.

Basically I just like the idea so I would like to try should it be technically feasable. And I'm trying to find ways to minimize the use of keys so I can make smaller keyboards but retain as much functionality as possible. It could very well be that its too impractical but I still want to try. It can also substitute for mouse functionality maybe. Luckily those thumbsticks aren't expensive so its no big loss if it doesn't pan out.

Edit it could be used as FN key as well.
Title: Re: Analog Thumbstick instead of arrows?
Post by: Findecanor on Thu, 13 October 2016, 16:29:47
Sure, but an analogue stick will not provide any tactile feedback for distinguishing between axes - which is something that arrow keys do. The digital joysticks in the '80's and early '90s that were considered the best allowed you to feel the axes quite distinctly.
Almost all gamepads with D-pads have individual buttons or the pads in a cross-shape so that you would be able to feel which direction your are going.

One way to compensate for it might be to add a kind of artificial hysteresis by increasing the radius of the zone that you are currently in. For instance, if your initial press is down then increase the radius of the "down" zone so that you would have to move farther to enter down/left or down/right. That way, you won't do that as easily by accident.

Your idea is not new. The Microsoft Arc keyboard has the right Control key replaced with a square D-pad the same size ... but  the reviews have not been good.
I have yet not tried it myself, but maybe the D-pad is simply too small and not well enough implemented: no directional feedback when you feel the pad and no tactile feedback when you press it.
Title: Re: Analog Thumbstick instead of arrows?
Post by: monkeyplusplus on Thu, 13 October 2016, 19:27:36
A friend of mine wants me to build him a keyboard with an analog stick like you posted in it. He's an avid Kerbal space program player and wanted to be able to use it for playing the game. I figured it would be really difficult to cobble together the firmware all on one controller, but if there was an on-board USB hub, you could just have two controllers, one for the analog stick powered by a stripped down adafruit trinket or something and one teensy for the keyboard. There's probably way better solutions though!
Title: Re: Analog Thumbstick instead of arrows?
Post by: 0100010 on Thu, 13 October 2016, 20:40:39
Make the WASD or arrow keys behave analog.


https://deskthority.net/workshop-f7/analog-numpad-with-hall-effect-sensors-t11191.html
Title: Re: Analog Thumbstick instead of arrows?
Post by: vextanys on Fri, 14 October 2016, 03:42:57
It is entirely possible to use 2 analog axes as a arrow keys replacement (not sure about how much hacking in TMK you'd need). The problems would be feedback (as mentioned above) and taking 2 specific pins out of the matrix may leave you short of pins (you need an ADC input pin per axis).

A slightly better feedback option would be a digital navigation switch (4-way or 5-way 'hat' switch) - I have seen one somewhere thats about Cherry MX sized with 4 directions (IIRC it was not cheap).

Getting the OS to recognize it as analog movements, not just arrow keys would require a new endpoint (keyboards dont do analog), probably a joystick, XBOX pad (with its own protocol problems) or generic HID device (which would require OS support)
Title: Re: Analog Thumbstick instead of arrows?
Post by: Dwarlorf on Fri, 14 October 2016, 05:59:23
I chose analog thumbstick because that's what I came across after a quick search on the internet. Didn't know to seach for 5 way hat switches. They're not that expensive, a couple of euros/dollars. They look like a good alternative. I intend to use it on a 7x4 matrix so if I'm not mistaken there should be enough pins left on the Teensy.
Title: Re: Analog Thumbstick instead of arrows?
Post by: Data on Fri, 14 October 2016, 06:24:20
(http://i.imgur.com/j2D8NAu.jpg)

DO IT.   :cool:
Title: Re: Analog Thumbstick instead of arrows?
Post by: xtrafrood on Fri, 14 October 2016, 06:29:43
Totally reminded me that I was looking up xbox chatpads earlier. I'm such a flake :-X
Title: Re: Analog Thumbstick instead of arrows?
Post by: philipVick on Fri, 14 October 2016, 09:59:40
Are those 5 way hat switches confortable? They seems to be pretty small
Title: Re: Analog Thumbstick instead of arrows?
Post by: Vagabond on Fri, 14 October 2016, 10:23:56
Try a IBM M13 with trackpoint!
Title: Re: Analog Thumbstick instead of arrows?
Post by: Dwarlorf on Fri, 14 October 2016, 11:37:59
Are those 5 way hat switches confortable? They seems to be pretty small

Probably not but I guess they can be modded with one of those psp thumbsticks thingies (https://www.amazon.com/PSP-Thumbstick-8-pk-Black-Sony/dp/B00EV5SSEU)

Try a IBM M13 with trackpoint!

Ive tried those trackpoints, don't like em. Besides I want to add it to my own keyboard not buy an existing keyboard.

Show Image
(http://i.imgur.com/j2D8NAu.jpg)


DO IT.   :cool:

Maybe I will. :D

(I might actually make a Pi tabletop arcade in the future)


Title: Re: Analog Thumbstick instead of arrows?
Post by: Data on Fri, 14 October 2016, 11:52:47
Show Image
(http://i.imgur.com/j2D8NAu.jpg)


DO IT.   :cool:

Maybe I will. :D

(I might actually make a Pi tabletop arcade in the future)

(http://i.imgur.com/9Eqs2FB.gif)
Title: Re: Analog Thumbstick instead of arrows?
Post by: Dwarlorf on Sun, 16 October 2016, 02:26:10
I found a switch which is easily available. Its an ALPS SKQUAAA010 and there are 4 way and 5 way versions of it.

The only thing is that I have no clue if its suitable due to its technical specs.

Operating Force    1.57N
Contact Voltage DC Nom    12V
Contact Current Max    50mA

Full specs: http://www.farnell.com/datasheets/85573.pdf

Can someone offer me some more insight on this?
Title: Re: Analog Thumbstick instead of arrows?
Post by: xtrafrood on Sun, 16 October 2016, 03:09:55
Side note: I found out that Xbox One controllers are plug-in-play through Linux distros with 4+ kernels. I'm totally going to grind with an Xbox One/Chatpad controller :)
Title: Re: Analog Thumbstick instead of arrows?
Post by: suicidal_orange on Sun, 16 October 2016, 03:19:39
Well force is how hard you have to press the switch for it to register, it's designed to be pressed so assuming you find a suitable 'keycap' that won't be a problem.  It could be too easy to press or too hard, but that's a personal opinion.

12V at 50mA is the maximum before the contacts get hot and likely melt the casing, 1V at 1uA is the minimum needed to overcome the resistance to have the signal pass through.  Keyboards operate at 5V with a constant voltage supply (only provides as many Amps as required to maintain the voltage) so I think you'd be running at the 5V at 5mA the lifespan was measured at - knowing marketing people that's probably the values where it lasted the longest.

So electrically it's perfect, the only thing that doesn't look ideal is that it's only 1cm wide and 3mm tall - if you put a big 'keycap' on it to make it as tall as other caps I think it will be too light, but as above you may like it :)
Title: Re: Analog Thumbstick instead of arrows?
Post by: Dwarlorf on Sun, 16 October 2016, 10:10:02
Well force is how hard you have to press the switch for it to register, it's designed to be pressed so assuming you find a suitable 'keycap' that won't be a problem.  It could be too easy to press or too hard, but that's a personal opinion.

12V at 50mA is the maximum before the contacts get hot and likely melt the casing, 1V at 1uA is the minimum needed to overcome the resistance to have the signal pass through.  Keyboards operate at 5V with a constant voltage supply (only provides as many Amps as required to maintain the voltage) so I think you'd be running at the 5V at 5mA the lifespan was measured at - knowing marketing people that's probably the values where it lasted the longest.

So electrically it's perfect, the only thing that doesn't look ideal is that it's only 1cm wide and 3mm tall - if you put a big 'keycap' on it to make it as tall as other caps I think it will be too light, but as above you may like it :)

Thanks for the insight. I'll order a couple next week and see how it fares.

It's gonna be a handwired keyboard, do I just add diodes to the pins like it's a regular switch? How do I go about it? Anyone?
Title: Re: Analog Thumbstick instead of arrows?
Post by: suicidal_orange on Sun, 16 October 2016, 10:37:06
Yes, you'll need diodes on each of the 4 outer pins.  You could connect them as part of the bottom row if you're short of pins on your controller, or as a separate 'column'.
Title: Re: Analog Thumbstick instead of arrows?
Post by: Dwarlorf on Sun, 16 October 2016, 12:58:21
Lets say I make it a row. Like this I suppose?:

[attachment]


Title: Re: Analog Thumbstick instead of arrows?
Post by: suicidal_orange on Sun, 16 October 2016, 13:59:22
Perfect :thumb:
Title: Re: Analog Thumbstick instead of arrows?
Post by: Dwarlorf on Sun, 16 October 2016, 14:23:26
Nice. Do you think if I take the 5 directional one (push stick down is #5) and I keep it pressed that it will send a continuous signal aka will it be like holding a key?
Title: Re: Analog Thumbstick instead of arrows?
Post by: suicidal_orange on Sun, 16 October 2016, 14:49:36
It will, not sure what happens if you hold it and press a direction at the same time though (if that's even possible)
Title: Re: Analog Thumbstick instead of arrows?
Post by: Dwarlorf on Sun, 16 October 2016, 14:56:15
It will, not sure what happens if you hold it and press a direction at the same time though (if that's even possible)

Hmm, interesting thought. It would be something if that was possible. Even more options.  ;D
Title: Re: Analog Thumbstick instead of arrows?
Post by: YoshiCaps on Sat, 22 October 2016, 22:00:44
Honestly if you were going to do it, I would buy one of those mice with a joystick like this one-
(http://solidsmack.com/wp-content/uploads/2012/02/lexip-3d-mouse-01.jpg)
Great for piloting games like warthunder, but for anything else it just sits on you mouse like an extra thumb. In all honesty, you plan to put it on the keyboard is great for little desk space (like a trackpoint) But I could imagine it would be weird for anything else.
Title: Re: Analog Thumbstick instead of arrows?
Post by: potatobot on Sat, 22 October 2016, 22:45:21
DO IT! Replace them arrows on TKLS haha
Title: Re: Analog Thumbstick instead of arrows?
Post by: Dwarlorf on Sun, 23 October 2016, 16:49:46
Well, I just ordered 2 5-ways. Let's see if I can get them to work after they've arrived.
Title: Re: Analog Thumbstick instead of arrows?
Post by: cribbit on Mon, 24 October 2016, 01:31:45
You'll have a lot more luck going down the route of essentially turning the stick into a switch that's four switches, pressed by moving the stick, than trying to keep the analog nature of the stick.

Would be really sick if you could convert the analog input of the stick to scroll speed, but that's incredibly difficult.
Title: Re: Analog Thumbstick instead of arrows?
Post by: Dwarlorf on Mon, 24 October 2016, 03:07:42
I didn't get analogs, I ordered the hat switches
Title: Re: Analog Thumbstick instead of arrows?
Post by: vextanys on Mon, 24 October 2016, 03:40:59
I have some of these switches, or similar, and the actuation is a more microswitched feel than Cherry MX - its less travel and a hard stop. The pins dont line up with standard veroboard and I've not tried them electrically, but from playing about with them they feel a lot like hat switches on joysticks.

And that mouse is almost exactly what I need... movement control on the right hand, leaving the left free for actions/spells/whatever :)
Title: Re: Analog Thumbstick instead of arrows?
Post by: Dwarlorf on Mon, 24 October 2016, 09:08:26
I intend them for a handwired board I hope I can mod a cherry switch casing. Then I will hook em up to a old plate first to find out if I can get them to work properly.

That mouse indeed is nice. I have a Logitech G502 but not all extra buttons are easily accessible. One little joystick if placed properly at the thumb might be better. But then again I don t want to  spend money on another mouse since my logitech is fairly new.
Title: Re: Analog Thumbstick instead of arrows?
Post by: Dwarlorf on Sat, 05 November 2016, 05:02:35
I intend them for a handwired board I hope I can mod a cherry switch casing.

Ok, this is not as easy as I thought. That plastic is tough! I want to remove the inside of the bottom part of the cherry switch. Maybe I don't have the right tools but cutting it with a hobby knive is not doable.
I've cut some with a Dremel but I don't have a proper bit to fully remove all the plastic inside, stem e.g.

Any ideas what else I can try? Melt it somehow?
Title: Re: Analog Thumbstick instead of arrows?
Post by: suicidal_orange on Sun, 06 November 2016, 14:48:42
For destroying plastic you'd be best off with a grinding bit for your dremel, looks like a short drill bit without the point.  A cheap one will be fine as plastic is not tough.  Also see how it reacts to different speeds - you want something between covering the room in dust and melting it so the grinder becomes black.

Other than that mini files will work, they make dust but without the spinning it won't cover everything in sight.
Title: Re: Analog Thumbstick instead of arrows?
Post by: Dwarlorf on Mon, 07 November 2016, 04:48:19
For destroying plastic you'd be best off with a grinding bit for your dremel, looks like a short drill bit without the point.  A cheap one will be fine as plastic is not tough.  Also see how it reacts to different speeds - you want something between covering the room in dust and melting it so the grinder becomes black.

Other than that mini files will work, they make dust but without the spinning it won't cover everything in sight.

I was just being too careful at first I actually managed to get it done.

[attach=1]
[attach=2]

I started modding the top part as well but while I was working at it it shot away and now I can't find it back.  :( Must be somewhere in the room though.

Its not symmetrical though so I don't think it will look nice. Maybe it isn't needed anyway when the stick gets a thumbpad