Always nice to see a seemingly simple system explained properly to uncover a hidden complexity I've never given much thought to before. Fascinating video.
10:02 And one nice thing about scan codes is they don’t distinguish between modifier and non-modifier keys; it’s just “key «n» has been pressed” and “key «n» has been released”, it’s up to the software to decide if key «n» is a modifier key or not. And you can distinguish between e.g. left-shift and right-shift (they have different scan codes), and implement other fun custom behaviours.
At least for USB: yes, they do. The state of the modifier keys is encoded in a single byte (which indeed allows a distinction between left-shift and right-shift), then other keys are transmitted individually. Sure, the software can decide what to do with that information, but the modifier keys do play a special role from the hardware perspective.
This is just superb, I have been researching "which keys are which notes on a piano?" for a while now, and I think this has helped. You ever tried - Penaycer Rudimentary Preponderance - (just google it ) ? It is an awesome one off guide for discovering how to play the piano easily minus the normal expense. Ive heard some unbelievable things about it and my colleague got amazing results with it.
It depends on the interface, XT, AT and PS/2 (PS/2 and AT are the same with just a new connector ) are interrupts , USB uses polling. PS/2 AT etc The computer does nothing , the keyboard controller polls the matrix and sends hardware interrupts to the CPU For USB the same thing happens but the keyboard does not send an interrupt, it holds the keys in a buffer till the computer polls it for key presses. Language does not change the scan code set ! AT PS/2 USB ect are ALL scan code set 2 , XT is scan code set 1 ( for some reason) and most terminals and pre PC computers mainframes , serial terminals etc use scancode set 3
USB is most certainly not using set 2 - for the reason why, look up what the scancode is for the arrow keys, which have a prefix for set 1 compatibility, or the Pause key which is 7 bytes long. USB keycodes are in alphabetic order and Z in particular is 1D (see HID usage tables, section 10 keyboard). Your firmware might be translating it for legacy OS support, however. Set 3 was more logical in that it used a single bit for press/release and one byte for each event. Also, the polling in USB is performed by the host controller, not the CPU, so we still have an interrupt for when things have changed. There are also buffers in both keyboards and port controllers for PS/2, AT etc, but the CPU typically has to handle them byte by byte.
One thing not mentioned is the "de-bouncing" circuit. As switches, the keyboard switches tend to "bounce" or "ring". One keypress produced not just one, but multiple key-down and key-up events. The "de-bouncer" ensures that these are picked up by the machine as a single press.
bvbk007 I agree with you. Might be worth mentioning software debouncing, that I've used on arduino projects. No extra components, the software does a very crude simulation of an RC network response. Maybe called a boxcar filter?
Back in the days of windows 95/98 and XP I used ports 0x60 and 0x64 to communicate with the keyboard controller directly and insert characters into the keyboards output buffer which were then read by windows as normal key presses. This let me get past several games anti cheat / botting software.
PS/2 interrupts, USB and Bluetooth do not. With the newer ones, the controllers have a buffer which the OS polls. Also, insulting the IBM model M is a bold strategy Cotton.
Years ago I used to program on a desktop system that used Hall Effect keys. The keyboard was specifically designed for data entry. It was made in Utica, NY and was originally called a Cogar System 4. Later Singer bought the company and called it a Singer 1501. When Singer was bought by ICL it became the ICL 1501. A VERY nifty system for its day.
The M is the epitome of keyboard perfection. There's a reason it is so remembered: It saw satisfying, comfortable, accurate, and near-indestructible. Very few keyboards achieve that level of quality, and those that do achieve it today are designed specifically in imitation of the M's design and always compared to it.
The earlier IBM beamspring is probably the best keyboard mechanism ever made. Unfortunately it comes with some real drawbacks like its huge size and complexity of the capacitive sensing circuitry used.
Yeh but they are amazing! I love mine. F uses capacitive sensing too but the controller is less fussy about dust etc. Thats why beamsprings come with contamination shields . Or did, they have all rotten away now.
Not sure about epitome, but certainly a classic. Have 3 model M keyboards that I used for many years, but now use WASD Code V2 keyboards, with Cherry MX blue switches at home and clears at the office. I like them all better than my M keyboards for layout and feel.
It would be really cool and suit your channel if you made a video about Docker and the differences on how Docker and a full virtual machine realize the virtualization! Love your channel!
"And this is basically the brains of the keyboard..." That's just some PCB track with gaps in, you've already looks at "the brains of the keyboard" on the other side.
This explains why when accessing button presses there are the methods GetKeyDown(Key), GetKeyUp(Key), and GetKey(Key). Thank you. And also if anybody knows about Scratch by MIT, their language was not great with those functions. It was very frustrating. Also I prefer quieter keyboards because I typically make videos about what typing and the noise in the video is annoying. But if I'm playing League or something I do like to hear that I have indeed pressed a key.
Can you please make a video about the history of focus stealing (foreground window and keyboard cursor) in operating systems and web browsers? It's quite an annoying issue in computing and still hasn't been addressed after decades!
Video comes up just as I'm doing an assignment that uses interrupts, instruction pointers and a like. On one hand, it's neat timing. On the other, it's the last thing I wanna see xD
11:00 onwards was a bit lacking in detail. HOW does the hardware interrupt the CPU? What happens - memory registers? Special pins on the CPU...what EXACTLY?
Grundibular the implementation varies a bit depending on the cpu itself, but generally speaking, the CPU will have an interrupt controller. When the controller itself receives an interrupt from a device, such as a key press, it will force the processor to save its state and jump to a special part of memory called an interrupt vector table. This table will then tell the cpu where to jump next, into what is called an interrupt service routine, which actually handles the new data. Once this is done, the cpu resumes its previous work.
if its a USB keyboard it doesn't interrupt the CPU, PS/2 keyboards do but USB ones rely once again on polling. USB devices communicate by sending 1 frame of data every 1/1000th of a second, this is why many gaming keyboards; in search of a gimmick to make themselves appear advantageous over normal ones... claim an update rate of 1000hz, simply they just send data out on every USB frame, most keyboards update at 125hz because 125 is 1/8th of 1000 so they only need to update on every 8th frame.
@@RWoody1995 technically speaking, your software does receive USB interrupts. They just aren't generated by the keyboard. To get the load off the CPU, dedicated hardware polls the keyboard at regular intervals, and sends an interrupt to the system when a change occurs
I remember I was asked this in a interview. I got to the interrupt handler in three sentences or less . So is the key value delivered to the current application? What’s the api for it to read ? It’s reading it using an api like a file ?
I presume he does actual work on his machines. Mechanical keyboards are usually frowned upon by coders due to their disturbing nature :) Sit in a cubicle etc with ten other people around you having those things and you'll understand why they're so hated
At 1:20, he’s trying to begin explaining to us how the circuitry of the keyboard receives a signal, only to be interrupted and asked how many keys are possible to be pressed. Still laughing.
but everytime if you mention interrupts - it's nice to explain that modern PCs just have four to eight CPUs in - quickly explaining that multicore is just an array of actual CPUs (cores) in one part of the PC.
You should make a series out of these, from the keyboard, through the usb/ps2 bus, to the driver, then the os, display driver, monitor, etc. The whole stack from input to output. - or maybe just talk about each piece of the stack for an episode. It's very computerphile centric.
Whoever invented the fn-key needs to get fired. Unlike the other control keys, "fn+A" doesn't actually register as a modification on 'A', meaning that you can't bind things to "fn+A" programmatically. Add to that the fact that there is no standard for fn-lock or no, and that the key itself is always on the opposite side of the keyboard from whatever you want to push it with... Top 3 horrible keyboard "features": 1. fn 2. right-click key 3. insert
what if I handbuilt a custom membrane keyboard? im already doing 90% of what the mechkeys community wants, is that enough to leave me alone? XD I do actually want to build a custom keyboard with some nice soft tactile switches, but they don't exist in the same form factor as cherrys or kaihls
This helped me decipher the difference between having a pathological or spiritual entity controlling the other end of the conversation when taking to an Artificially intellegent source and having the genuine thing. Thank you. I'm a little paranoid.
Anyone remember the times where you could push (at most) three keys simultaneously? :) My first computer would at that point freeze for the duration of beep (from the speaker at the bottom of the computer case) repeatedly until some keys were released.
you don't need a microcontroller though, you can scan using a 555 timer and counter IC, then run the result of the matrix through various logic gates to create a binary code output, I guess this could get quite complex when dealing with a computer keyboard, I have only done it with a numeric keypad. Anyway I guess then what happens is the result updates a register, and whenever a key press is detected to have occurred, an interrupt is sent to the CPU periodically, the CPU then reads your keyboard register when it wants to.
Great video! I remember opening up my PSP and wondering how the circuit board worked and how it could tell which button was being pushed when they were both connected
Now I understand why in javascript you can't just ask if "W" is pressed, but instead check if the keyboard tells if a key is pressed and if that key is coincidentally keyCode 87 and then ask if a key is released and if that was coincidentally also keyCode 87.
2:06 Or there would be, if your hardware implemented “n-key rollover”, which means it can distinguish every possible combination of keys being pressed at once. Not sure if current keyboard hardware actually supports that.
Hmm one question remains for me: Back in the days, why was I able to boost and steer right at the same time in Need for Speed but not able to boost and steer left (shift + arrow keys)? And why was my friend able to do it on his computer with his keyboard?
I do game with green, but I mostly use push-to-talk so it's cool. I love the feedback and the clack when typing. I used blues for years, but when I heard about greens I had to try them, and I love them. Have you tried typing on green? So fast and satisfying. I can't even find my keyboard (vortex pok3r) with the option for green switches anymore, so I consider it a limited edition :)
Questions about the fanfold greenbar paper used in so many of these videos. Why/how do they have so much of it? Are they using up leftover/surplus inventory from a bygone era? Are there still dot matrix printers in use at the university? I'm dying to know.
How does the computer handle multiple keyboards? Can I tell it to ignore the numlock setting (and regard it as always on) for one specific keyboard only? Do I have to write my own Linux driver for that?
Off topic, but can you create a video about the SWARM robots project from Rolls Royce, the Universities of Nottingham and Harvard for car engine inspections?
I love it. He was all ready to rock on until ... that wonderfully cryptic question. Spent the rest of the video talking about the hardware / software interface. Yes, I am a firmware engineer.
I don’t know why that “keyboard not found, press a key to continue” thing is considered such a joke. It makes sense, after all, that if the hardware requires a keyboard to continue, it should wait for you to connect one.
If we discuss on keyboard types here: Microsoft Modern Keyboard (or Surface Keyboard) and for mobile devices ideally their Surface type covers... your preference may be different, but nothing is better than a Surface Keyboard or the Apple Keyboard (but I hate Apple for not giving the Apple keyboard a numpad - a numpad is a must and it has to be default on - with every OS you run it with... I do not use the numpad functions on the keys when the numpad is off - ever...)
Just near the end when you spoke about how the OS handles input, would it be possible (not practical) to leave a computer without resources by using keyboards?
Plus It sets you up for a quick move, either to an office so no one is bothered by your keeb, or out the door, so no one is bothered by your keeb. Otherwise, the company is liable for the PTSD your office mates suffer, from being under attack all day!
Hmmm, what about keyboard polyphony? From experience, even cheap keyboards have 5 key polyphony (five key-presses can be performed at the same time). ??? I'm thinking it has to do with the microcontroller being able to differentiate between micro-second delay times that out brains and hands can not. ??? _Edit:_ This question stems from my experience with DAW's and VST's in music production. After thinking about it more, ...it's probably a software thing. ;) But I'm still curious.
In the DOS era the interrupt just interpreted the scan code and put the scan code and the ASCII code in a buffer and then it was for the software to check if there were characters in the buffer. Is it somehow more sophisticated with Windows?
In Windows, the currently focused window gets sent a message when a key is pressed. There is WM_KEYUP and WM_KEYDOWN for the "key pressed" or "key released" messages (including repeats if you hold down a key) and WM_CHAR when the OS converts one or more keypresses into a character, depending on the current language (this can get very complicated for languages with lots of characters like Japanese). The application typically passes control to the OS and asks it to wake it up when there's a new message for it.
In this line scanning model, what happens when I press a key in the current row, one below on the same column, and one more on the same row as the second key. Do I get a false detection on the scanned row?
In other words, there are *one nonillion, two hundred sixty-seven octillion, six hundred fifty septillion, six hundred sextillion, two hundred twenty-eight quintillion, two hundred twenty-nine quadrillion, four hundred one trillion, four hundred ninety-six billion, seven hundred three million, two hundred five thousand, three hundred seventy-six* different key combinations on a standard keyboard.
hi, I would like to develop a language pack, then add an engine work in the background, which will works like a sentences corrector, all what I found is about how to install a language pack, any idea where to start ? .
TheTurnipKing - The first computer with a chiclet keyboard was the Interact Model One (1978). Virtually everything that came out in '82 and '83 had one, so singling out the Spectrum is a little unfair.
@@Tevildo the Sinclair machines are neat though because you can see the evolution from bare membrane in the ZX80, to the rubber mat over membrane to the plastic key over rubber mat over membrane that characterises modern keyboard design
You mentioned when a key is released, the hardware would send a signal to the computer to say a key release event has happened - but how does the HW know a key is released, would it not need some kind of memory to check which keyboard link lines were being pressed at the previous scan?
Quite right! That's part of what the program in that microcontroller handles. USB keyboards process things slightly differently, in that they report a list of currently pressed keys instead of press/release events.
Thanks LoneTech. So the microcontroller is part of the keyboard, am I correct? So the Computer OS does not need to monitor for key presses, just wait for a key pressed/released interrupt event, yes?
Always nice to see a seemingly simple system explained properly to uncover a hidden complexity I've never given much thought to before. Fascinating video.
"I like my keyboards soft and mushy" quote of the day :D
it goes through tons of layers of abstractions until it reaches some bad electron based application
This is the real story.
Or when I'm testing my program, a poorly written SDL application
🤮
10:02 And one nice thing about scan codes is they don’t distinguish between modifier and non-modifier keys; it’s just “key «n» has been pressed” and “key «n» has been released”, it’s up to the software to decide if key «n» is a modifier key or not. And you can distinguish between e.g. left-shift and right-shift (they have different scan codes), and implement other fun custom behaviours.
At least for USB: yes, they do. The state of the modifier keys is encoded in a single byte (which indeed allows a distinction between left-shift and right-shift), then other keys are transmitted individually. Sure, the software can decide what to do with that information, but the modifier keys do play a special role from the hardware perspective.
@@floxbr9350yeah i learnt that in ben eater's video about usb
"I like my keyboards soft and mushy" *laughs in mechanical*
BHURGVFDI SHOUIE UIEFSL BEVI BUSIOEV VSBUYEOI HUEVSJKD
Your laugh in mechanical.
@Red Dunkey ygudhhbiuhvjkfkyuhrgnkvhjbikrtuhjgesguhyurhgbjvhgfbvsuyehbnxeruyvhbsiyurghbnvuihsgbxbenuyrghubdfiyugshb
@Red Dunkey uygjvj
I find the clickety-clacking to be highly therapeutic.
This is just superb, I have been researching "which keys are which notes on a piano?" for a while now, and I think this has helped. You ever tried - Penaycer Rudimentary Preponderance - (just google it ) ? It is an awesome one off guide for discovering how to play the piano easily minus the normal expense. Ive heard some unbelievable things about it and my colleague got amazing results with it.
It depends on the interface, XT, AT and PS/2 (PS/2 and AT are the same with just a new connector ) are interrupts , USB uses polling.
PS/2 AT etc The computer does nothing , the keyboard controller polls the matrix and sends hardware interrupts to the CPU
For USB the same thing happens but the keyboard does not send an interrupt, it holds the keys in a buffer till the computer polls it for key presses.
Language does not change the scan code set ! AT PS/2 USB ect are ALL scan code set 2 , XT is scan code set 1 ( for some reason) and most terminals and pre PC computers mainframes , serial terminals etc use scancode set 3
USB standards specifies a scan code for USB keyboards, it does not use set 2 (AT). Or if does it is non-compliant with the USB standard for keyboards.
Yes your correct. But they use the same codes in the background so 2c is Z in USB and in Set 2 so its short hand.
\[T]/
USB is most certainly not using set 2 - for the reason why, look up what the scancode is for the arrow keys, which have a prefix for set 1 compatibility, or the Pause key which is 7 bytes long. USB keycodes are in alphabetic order and Z in particular is 1D (see HID usage tables, section 10 keyboard). Your firmware might be translating it for legacy OS support, however. Set 3 was more logical in that it used a single bit for press/release and one byte for each event. Also, the polling in USB is performed by the host controller, not the CPU, so we still have an interrupt for when things have changed. There are also buffers in both keyboards and port controllers for PS/2, AT etc, but the CPU typically has to handle them byte by byte.
I agree. This video is quite oversimplified and erroneous at times.
One thing not mentioned is the "de-bouncing" circuit. As switches, the keyboard switches tend to "bounce" or "ring". One keypress produced not just one, but multiple key-down and key-up events. The "de-bouncer" ensures that these are picked up by the machine as a single press.
noferblatz you can also fix this with many many diodes (one for each key) , no ghosting then :)
Andrew Joy you can use diodes to debounce? I've used caps, but never heard of diodes.
Diodes can't be used for debouncing, usually. I think Andrew is mistaken. Ghosting and debouncing are independent of each other.
bvbk007 I agree with you. Might be worth mentioning software debouncing, that I've used on arduino projects. No extra components, the software does a very crude simulation of an RC network response. Maybe called a boxcar filter?
bvbk007 ok, just making sure I didn't fall asleep in Electronics or something.
Back in the days of windows 95/98 and XP I used ports 0x60 and 0x64 to communicate with the keyboard controller directly and insert characters into the keyboards output buffer which were then read by windows as normal key presses. This let me get past several games anti cheat / botting software.
why would you want to cheat?
Dr. Bagley's shirt needs some texture filtering.
Some ray tracing
Newton’s Third Law, action = reaction; contemplate the Zen of physics: when you a press a key, the key presses back.
I pushed "H" on keyboard, but nothing happened..... :(
Does computer have to be turned on?
No, computer doesn't need to be on. It sounds like your keyboard is not working. Have you tried restarting your keyboard?
Jeremy Elliot
Yes, i tried, with torch, as always. Did not help.
Maybe it needs new oil and spark plugs?
We'll it does need the voltage to apply to the rows somehow. Try plugging it into a battery
This is normal. You have a French keyboard, and the "H" is silent in French. HTH. HAND.
No, you need to have common sense.
PS/2 interrupts, USB and Bluetooth do not. With the newer ones, the controllers have a buffer which the OS polls. Also, insulting the IBM model M is a bold strategy Cotton.
Years ago I used to program on a desktop system that used Hall Effect keys. The keyboard was specifically designed for data entry. It was made in Utica, NY and was originally called a Cogar System 4. Later Singer bought the company and called it a Singer 1501. When Singer was bought by ICL it became the ICL 1501.
A VERY nifty system for its day.
Has someone already roasted this guy?
The M is the epitome of keyboard perfection. There's a reason it is so remembered: It saw satisfying, comfortable, accurate, and near-indestructible. Very few keyboards achieve that level of quality, and those that do achieve it today are designed specifically in imitation of the M's design and always compared to it.
No way , model F any day !
The earlier IBM beamspring is probably the best keyboard mechanism ever made. Unfortunately it comes with some real drawbacks like its huge size and complexity of the capacitive sensing circuitry used.
Yeh but they are amazing! I love mine. F uses capacitive sensing too but the controller is less fussy about dust etc. Thats why beamsprings come with contamination shields . Or did, they have all rotten away now.
Not sure about epitome, but certainly a classic. Have 3 model M keyboards that I used for many years, but now use WASD Code V2 keyboards, with Cherry MX blue switches at home and clears at the office. I like them all better than my M keyboards for layout and feel.
It would be really cool and suit your channel if you made a video about Docker and the differences on how Docker and a full virtual machine realize the virtualization!
Love your channel!
I dig how the game Steve thinks up off the top of his head is Quake. Right on mate
After the model m comment
*audible gasp*
How can a computer expert not like the model M? It's perfect!
I guess he's not a touch typist. I'm typing this on a Model M.
@@RaymondHng me too
"And this is basically the brains of the keyboard..."
That's just some PCB track with gaps in, you've already looks at "the brains of the keyboard" on the other side.
Yep, those were the feelers.
What I want to know is what happens when I press the key?
This explains why when accessing button presses there are the methods GetKeyDown(Key), GetKeyUp(Key), and GetKey(Key). Thank you. And also if anybody knows about Scratch by MIT, their language was not great with those functions. It was very frustrating.
Also I prefer quieter keyboards because I typically make videos about what typing and the noise in the video is annoying. But if I'm playing League or something I do like to hear that I have indeed pressed a key.
Do touch sensors next!!!
Can you please make a video about the history of focus stealing (foreground window and keyboard cursor) in operating systems and web browsers? It's quite an annoying issue in computing and still hasn't been addressed after decades!
i will look for a link that shows you. thankyou
Video comes up just as I'm doing an assignment that uses interrupts, instruction pointers and a like. On one hand, it's neat timing. On the other, it's the last thing I wanna see xD
11:00 onwards was a bit lacking in detail. HOW does the hardware interrupt the CPU? What happens - memory registers? Special pins on the CPU...what EXACTLY?
Grundibular the implementation varies a bit depending on the cpu itself, but generally speaking, the CPU will have an interrupt controller. When the controller itself receives an interrupt from a device, such as a key press, it will force the processor to save its state and jump to a special part of memory called an interrupt vector table. This table will then tell the cpu where to jump next, into what is called an interrupt service routine, which actually handles the new data. Once this is done, the cpu resumes its previous work.
if its a USB keyboard it doesn't interrupt the CPU, PS/2 keyboards do but USB ones rely once again on polling. USB devices communicate by sending 1 frame of data every 1/1000th of a second, this is why many gaming keyboards; in search of a gimmick to make themselves appear advantageous over normal ones... claim an update rate of 1000hz, simply they just send data out on every USB frame, most keyboards update at 125hz because 125 is 1/8th of 1000 so they only need to update on every 8th frame.
@@RWoody1995 technically speaking, your software does receive USB interrupts. They just aren't generated by the keyboard.
To get the load off the CPU, dedicated hardware polls the keyboard at regular intervals, and sends an interrupt to the system when a change occurs
I remember I was asked this in a interview. I got to the interrupt handler in three sentences or less .
So is the key value delivered to the current application? What’s the api for it to read ? It’s reading it using an api like a file ?
Most new motherboards that I'm aware of don't have a true PS/2 port. It has a built-in adapter. USB I believe.
Dose this guy not know about the modern mechanical keyboard market? Like come on
of course he does. that's why he said he just started a flame war when He mentioned the Model M.
Model M isn't a modern mechanical keyboard though, so it's not really proof that he's aware of the modern mechanical keyboard movement/fad.
As an r/MechanicalKeyboards member I am offended by his taste in keyboards....
Hey its dome over PCB is basically a realforce in all but name !
Myself i prefer a good beamspring, or some nice complicated alps.
DT > Reddit :P
He said "I like my keyboard soft and mushy" and I was like no no no no NO NO NO
quangluu96 I mean their videos are mostly software related so I get why he didn't go into too much detail.
I presume he does actual work on his machines. Mechanical keyboards are usually frowned upon by coders due to their disturbing nature :) Sit in a cubicle etc with ten other people around you having those things and you'll understand why they're so hated
You can get quiet mechanical keyswitches that are a decent compromise.
what a baller! got 2 imacs instead of two monitors and a mac
I lol'ed!!! :D
Maybe he's particularly decadent and uses one of them in target display mode for the other…
How dare you saying that about the beloved, eternal, all clacky Model M. Heresy!
Nice paper man, very nice touch!
At 1:20, he’s trying to begin explaining to us how the circuitry of the keyboard receives a signal, only to be interrupted and asked how many keys are possible to be pressed. Still laughing.
A letter appears on the screen. Next question.
Lauren Hahn end of story, video length = 2 seconds. 12 minutes and 26 seconds saved :) genius
but everytime if you mention interrupts - it's nice to explain that modern PCs just have four to eight CPUs in - quickly explaining that multicore is just an array of actual CPUs (cores) in one part of the PC.
You should make a series out of these, from the keyboard, through the usb/ps2 bus, to the driver, then the os, display driver, monitor, etc. The whole stack from input to output. - or maybe just talk about each piece of the stack for an episode. It's very computerphile centric.
I was expecting something like this when I first saw the title, I'm really disappointed :(
I really appreciated the graphic diagrams.. very well done. Thanks.
On the Apple ][, if you press 1, 2, and 3 at the same time, it would also get an S, or something like that.
I liked at the end how his example of a computer game was something from 25 years ago. I bet half the viewers are younger than that game.
he could have been refering to quake champions - or at least heard about it which is why quake was at the forefront of his mind :)
Excellent videos Steve!!
Whoever invented the fn-key needs to get fired. Unlike the other control keys, "fn+A" doesn't actually register as a modification on 'A', meaning that you can't bind things to "fn+A" programmatically. Add to that the fact that there is no standard for fn-lock or no, and that the key itself is always on the opposite side of the keyboard from whatever you want to push it with...
Top 3 horrible keyboard "features":
1. fn
2. right-click key
3. insert
i wanna make a mouse keyboard now
make a second video explaining the software sides of it
"I like my keyboards like I like my peas: soft and mushy."
The only thing missing from this video is Dr. Bagley literally dropping a microphone and walking off set.
Somewhere out there when a key is pressed.... a paradise
did you even talk about debouncing the button signal? i might have missed it
Press F to Pay Respects
I rather enjoy this episode. I like the basic breakdowns of computers into their electronic components.
Is an IRQ (interrupt request) done by hardware on the cpu?
This is part 1, right? Did not even mention interrupts yet.
"I love my keyboards soft and mushy"
You should be ashamed of yourself!!!
what if I handbuilt a custom membrane keyboard? im already doing 90% of what the mechkeys community wants, is that enough to leave me alone? XD
I do actually want to build a custom keyboard with some nice soft tactile switches, but they don't exist in the same form factor as cherrys or kaihls
I paused the video and counted the number of keys...
.
.
.
.
.
.
.
My keyboard's got 103 keys.
This helped me decipher the difference between having a pathological or spiritual entity controlling the other end of the conversation when taking to an Artificially intellegent source and having the genuine thing. Thank you. I'm a little paranoid.
I like my keys soft and mushy? Pah, no taste at all.
D I SG R AC EF UL !
Anyone remember the times where you could push (at most) three keys simultaneously? :) My first computer would at that point freeze for the duration of beep (from the speaker at the bottom of the computer case) repeatedly until some keys were released.
I had forgotten all about this. . . then you mentioned the beep.
you don't need a microcontroller though, you can scan using a 555 timer and counter IC, then run the result of the matrix through various logic gates to create a binary code output, I guess this could get quite complex when dealing with a computer keyboard, I have only done it with a numeric keypad. Anyway I guess then what happens is the result updates a register, and whenever a key press is detected to have occurred, an interrupt is sent to the CPU periodically, the CPU then reads your keyboard register when it wants to.
Great video! I remember opening up my PSP and wondering how the circuit board worked and how it could tell which button was being pushed when they were both connected
Based on that fly shirt, I suppose the stereotype of computer scientist's being fashionably obtuse is only an American thing
You guys make awesome knowledge videos
I would have liked to see more on the software side.
Appropriate quake reference is appropriate😀
Now I understand why in javascript you can't just ask if "W" is pressed, but instead check if the keyboard tells if a key is pressed and if that key is coincidentally keyCode 87 and then ask if a key is released and if that was coincidentally also keyCode 87.
2:06 Or there would be, if your hardware implemented “n-key rollover”, which means it can distinguish every possible combination of keys being pressed at once. Not sure if current keyboard hardware actually supports that.
Hmm one question remains for me: Back in the days, why was I able to boost and steer right at the same time in Need for Speed but not able to boost and steer left (shift + arrow keys)? And why was my friend able to do it on his computer with his keyboard?
If I heard him correctly, 2 to the 100 keyboard combinations is a number greater than the number of atoms in the universe.
You would hate my keyboard; pbt double shot keycaps on metal base with MX greens :)
I hope you're not gaming on green; seems like a bad choice. Heck green seems unnecessary for anything.
I do game with green, but I mostly use push-to-talk so it's cool. I love the feedback and the clack when typing. I used blues for years, but when I heard about greens I had to try them, and I love them. Have you tried typing on green? So fast and satisfying. I can't even find my keyboard (vortex pok3r) with the option for green switches anymore, so I consider it a limited edition :)
Questions about the fanfold greenbar paper used in so many of these videos.
Why/how do they have so much of it?
Are they using up leftover/surplus inventory from a bygone era?
Are there still dot matrix printers in use at the university?
I'm dying to know.
How does the computer handle multiple keyboards? Can I tell it to ignore the numlock setting (and regard it as always on) for one specific keyboard only? Do I have to write my own Linux driver for that?
3:33 haha, I'm getting stressed just thinking about how much trouble it's going to be to put the keyboard back together after the video
Off topic, but can you create a video about the SWARM robots project from Rolls Royce, the Universities of Nottingham and Harvard for car engine inspections?
I like how the subtitles just give up at around 2:20.
I love it. He was all ready to rock on until ... that wonderfully cryptic question. Spent the rest of the video talking about the hardware / software interface.
Yes, I am a firmware engineer.
I was expecting to see jokes in the comments about pressing the ANY key or "Keyboard not found, press F1 to continue"
I don’t know why that “keyboard not found, press a key to continue” thing is considered such a joke. It makes sense, after all, that if the hardware requires a keyboard to continue, it should wait for you to connect one.
3:45 shots fired! XD
dangit now i cant type how helpful this is
What's the ASCII code for the "Any" key?
I don't see any any key!
If we discuss on keyboard types here: Microsoft Modern Keyboard (or Surface Keyboard) and for mobile devices ideally their Surface type covers... your preference may be different, but nothing is better than a Surface Keyboard or the Apple Keyboard (but I hate Apple for not giving the Apple keyboard a numpad - a numpad is a must and it has to be default on - with every OS you run it with... I do not use the numpad functions on the keys when the numpad is off - ever...)
This guy offended an entire group of pc users at once by saying he likes keys soft and mushy
Lineprinter paper! Reminds me of computer science A level in the seventies...cool!
Just near the end when you spoke about how the OS handles input, would it be possible (not practical) to leave a computer without resources by using keyboards?
Microsoft Word is essentially a printing press simulator with lots of bells and whistles...
"An A press is an A press"
Cherry MX blue keyswitches for life! If your officemate doesn't think you are under machine gun attack its not a real keyboard!
Plus It sets you up for a quick move, either to an office so no one is bothered by your keeb, or out the door, so no one is bothered by your keeb.
Otherwise, the company is liable for the PTSD your office mates suffer, from being under attack all day!
There are different codes called make and break codes for when a key is pressed vs released.
Hmmm, what about keyboard polyphony? From experience, even cheap keyboards have 5 key polyphony (five key-presses can be performed at the same time). ???
I'm thinking it has to do with the microcontroller being able to differentiate between micro-second delay times that out brains and hands can not. ???
_Edit:_ This question stems from my experience with DAW's and VST's in music production. After thinking about it more, ...it's probably a software thing. ;)
But I'm still curious.
In the DOS era the interrupt just interpreted the scan code and put the scan code and the ASCII code in a buffer and then it was for the software to check if there were characters in the buffer. Is it somehow more sophisticated with Windows?
In Windows, the currently focused window gets sent a message when a key is pressed. There is WM_KEYUP and WM_KEYDOWN for the "key pressed" or "key released" messages (including repeats if you hold down a key) and WM_CHAR when the OS converts one or more keypresses into a character, depending on the current language (this can get very complicated for languages with lots of characters like Japanese). The application typically passes control to the OS and asks it to wake it up when there's a new message for it.
Never would have known that cpu scans keyboard electronically like it scans monitor
Cool
Learns new things everytime
3:34 What about “buckling spring”, e.g. Cherry MX switches?
huh, The video was cut short. I assume there is a part 2.
Part 2 when? I wanna know how a UNIX system handles these
Just how any other OS handles it? Throw a keymap on it and display the pressed key.
In this line scanning model, what happens when I press a key in the current row, one below on the same column, and one more on the same row as the second key. Do I get a false detection on the scanned row?
Your are doing a great job! One recommendation, English subtitles please..couldn't get the accent right!
"those annoying model m's..." what
In other words, there are *one nonillion, two hundred sixty-seven octillion, six hundred fifty septillion, six hundred sextillion, two hundred twenty-eight quintillion, two hundred twenty-nine quadrillion, four hundred one trillion, four hundred ninety-six billion, seven hundred three million, two hundred five thousand, three hundred seventy-six* different key combinations on a standard keyboard.
can you guys add subtitle?
I'm curious about why there is a swedish keyboard there. Seems a bit random, but being swedish myself I like it. What's the story?
The Swedish keyboard layout has keys to generate the letters å, ä, and ö. Norwegian and Danish keyboard layouts generate å, ø, and æ.
@@RaymondHng well, yes. But why does British computer science guys need that?
Maybe he knows Swedish.
Det är möjligt
1:58 but the wires are multiplexed
hi, I would like to develop a language pack, then add an engine work in the background, which will works like a sentences corrector, all what I found is about how to install a language pack, any idea where to start ? .
I'm not actually certain but I think the modern rubber dome keyboard probably owes a fair bit to the design of the Sinclair keyboard.
TheTurnipKing - The first computer with a chiclet keyboard was the Interact Model One (1978). Virtually everything that came out in '82 and '83 had one, so singling out the Spectrum is a little unfair.
@@Tevildo the Sinclair machines are neat though because you can see the evolution from bare membrane in the ZX80, to the rubber mat over membrane to the plastic key over rubber mat over membrane that characterises modern keyboard design
When euro was introduced they actually sold new keyboards for people by saying that it has the euro character.
You mentioned when a key is released, the hardware would send a signal to the computer to say a key release event has happened - but how does the HW know a key is released, would it not need some kind of memory to check which keyboard link lines were being pressed at the previous scan?
Quite right! That's part of what the program in that microcontroller handles. USB keyboards process things slightly differently, in that they report a list of currently pressed keys instead of press/release events.
Thanks LoneTech. So the microcontroller is part of the keyboard, am I correct? So the Computer OS does not need to monitor for key presses, just wait for a key pressed/released interrupt event, yes?
kranser correct. Seperate interrupts are sent for key press and release.