geekhack
geekhack Projects => Making Stuff Together! => Topic started by: masilver on Wed, 08 August 2018, 01:07:58
-
After much hacking around in the qmk firmware (I'm not much of a C programmer), I was finally able to get an LCD connected to my 122-key Model M. I will integrate it into the shell next.
[attach=1]
So far, I have CAPS LOCK, NUM LOCK and total key press displayed. I probably don't need CAPS LOCK displayed, as the keyboard's caps lock key has been remapped.
My question is, what should I display on the LCD? I can't think of anything else.
...Thanks...
...Michael...
-
I really want a calculator mode built into my keyboards.
My Cherry (Reuters) G80-9009 Keyboard has a calculator mode built in. It is way cool.
I have some code for a simple RPN calculator that runs on a Beetle ATmega32u4-based
Microcontroller that I'd be happy to share. It's not tied into the rest of the keyboard code, yet.
16 characters is not an unreasonable display foe a lot of calculations, for example it can display
-9,999,999.99999, or similar.
If you're doing modifiers on a more complex programable keyboard you could display something like:
- ____ - No shift down
- Shft - Single-shot shift mode (next key is shifted)
- SHFT - Shift modifier locked down (everything is shifted until Shift is pressed again)
Repeat for Ctl, Win, Opt, so with everything locked you get "SHFT CTL WIN OPT" displayed. (16 characters, 1 row)
If you support use SpaceFn you could display that and the current layer (name or number) on line 2.
All the best!
-
i'd put a simple date and time clock on it if it were me
i can't think of anything else that i wouldn't be able to get from the computer itself, and a clock is not always visible if you're running a full screen application or something
-
These are great ideas. I never though of a calculator. I can see that being a can of worms, at least with my C programming skills on a Teensy. Very cool idea. I'm going to think about that. :-(
The clock is a great idea, but there is no real-time clock on the Teensy. I think you can add a board that comes with a battery and RTC. It does have a ms timer built-in, but that's not of much use. The other thing qmk doesn't offer me is a reasonable loop to update a time and date from, i.e., real time updating of the clock. I think it's because I'm only using the converter code.
...Michael...
-
The end of this post (https://deskthority.net/post415691.html#p415691) contains the list of things which I'm showing on the LCD. I plan to change the layer name with the configuration name and layer number in the future though. Also it is not QMK firmware.
I would not be inclined to put a calculator there. A keyboard is used with a computer and there are many great free calculator applications to used on a PC. From simple ones like calc, through interpreters (like python, ghci) to very powerful environments for math like wxmaxima or octave.
-
Yeah, sometimes it's nice to just add up a few numbers without launching an app.
Also, looks like I neglected to suggest:
include a key in calc mode that sends the results out the USB port (like Paste) and then drops out of calc mode.
Up to the OP of course. Just offering a suggestion. :D
-
The biggest problem with a calculator in a keyboard is that it will not show you enough history. Well that is the problem with most cheap calculators :-)
"Pasting" from calculator mode: You mean a calculator in a keyboard as a way to enter a number in an application which does not accept expressions in the input field. I can imagine that to be occasionally useful. Although I cannot think of an application where I would use it just now.
-
WPM counter. Show current WPM and maximum.
I would use a n-sized circular buffer of bytes with timings of the last key strokes and present the WPM as a value calculated from the average. Provide a valid reading only when the buffer is full, thus requiring at least n readings before the counter appears.
Clear the buffer when nothing has been typed for m seconds. Do not start recording until the delay is shorter than o milliseconds. Would require a bit of trial and tweaking to get the values of n, m and o.
You might need to count the current key stroke measurement in milliseconds in a 16-bit integer and shift it down to store into the buffer. Easiest to do in a firmware that has a millisecond loop but if it doesn't, you could use the SOF interrupt for the clock: the USB host triggers a SOF ("start of frame") every millisecond.
-
WPM?
Maybe rather number of key presses, or both :)
-
I think a period specific digital clock to match the keyboard would look rather classy.
-
Following vvp's Katy link (cool project) I see there's a list of LCD functions there, for your consideration.
From: https://deskthority.net/workshop-f7/katy-keyboard-or-k80cs-key80-contoured-split-t8524-150.html
>>> What's the purpose of the screen?
It shows:
current layer name (one of Normal, Keypad, Function)
one letter indicator whether macros or programs are enabled
light sensor raw value (it equal to about ½ of lux)
which lock is active (Caps/Scrol/Num) .. these are indicated also by the LEDs (which have brightness control based on the data from the light sensor)
small help indicating what is the state of the keyboard when one is programming macros or remaping keys
a value of the current divisor when configuring how many times the mouse pointer speed or the mouse wheel speed is slower than the keyboard polling rate (which is 2 ms)
error messages (e.g. "USB Wait" when host is not communicating with the keyboard)
-
Damn, these are really some good ideas. I may be able to add the words per minute. I did find a loop to hook into, but I'll have to figure out the timing. One loop is somewhere south of a ms. Actually, nevermind, there is a ms clock. I just remembered.
Displaying the time will require an additional purchase of a RTC, which I'm not opposed to, but then I'd have to write the code to set the clock and I need a break from heavy troubleshooting.
I did add code to store the keycount in the EEPROM and also display "SUSPENDED" if the computer is in sleep mode.
I'm already addicted to watching my key count rise, but I'm also a bit of a stats nerd.
[attach=1]
BTW, I posted my code changes on github: https://github.com/masilver99/qmk_firmware
I guess I'll work on WPM next. I need more stats!
...Michael...
-
Maybe make a plugin for things like CPU utilization, HDD activity, maybe even make it display currently not responding processes or things like that? I believe RIVATuner will output to certain logitech keyboards, maybe it's possible to make it output to yours?
-
@masilver:
I added the key press counter as well. When typing the LCD shows the counter. When typing stops, after a timeout, the light sensor value is shown again. It is kind of stupid feature but very easy to implement and it is fun to follow the counter to rise :-D Well I bet it gets boring over time.
@FenixtheCorgi:
That requires either the custom keyboard driver or making the keyboard a composite device ... probably with a serial port and a custom protocol to update keyboard LCD from a PC application. There are some billboard and display classes in USB spec but I do not know whether they can be used.
Summary: this is a major project compared to keystroke counter (which takes only about an hour to do) and it will require also custom software on the PC side. I'm not also sure why it would be good to show this on a keyboard LCD. It looks to me that it would be better to show it on the monitor (where applications for this already exist).