YTread Logo
YTread Logo

The Art of the Bodge: How I Made The Emoji Keyboard

May 30, 2021
Many techies are surprised when I say I primarily use Windows. Why would someone who writes code and edits videos use Windows? Two reasons: one, it's cheaper and two, it allows me to bid. So sit back and relax because yes, I am going to tell you how I

made

the

emoji

keyboard

. But first I will explain to you what

bodge

n is. Bodging is a big British word that means making temporary repairs. A

bodge

is very clumsy. It's not elegant and will fall apart, but it will work. And it will continue to work as long as there is someone around who can repair it if it breaks.
the art of the bodge how i made the emoji keyboard
Remember that part in Apollo 13 where they have to put the square in the round opening? That's silly. In fact, it is the largest bodge ever created by man. Great, I'm curious if you can find a better one in the comments. Because there is probably a book of the greatest bodges in history that could be written and I would like to be the one to write it. In any case, Bodging has always been my way of doing things. I didn't study computer technology and I don't write elegant solutions. I patch things together. The most important parts (backups, password protection) I make sure are in order... but the things I do for fun, I foreshadow.
the art of the bodge how i made the emoji keyboard

More Interesting Facts About,

the art of the bodge how i made the emoji keyboard...

I learned how to fake it properly when I was filming a TV show a few years ago. Some parts of that program also appeared on the web. I'll put the links in the video description, but stay here for a while because you need some context on this. I was filming with two others. Colin Furze, who you may know from YouTube, makes ridiculously large physical objects that explode and holds the land speed record for a mobility scooter. And then there's Charles Yarnold, who makes complicated microelectronics with Arduinos and printed circuit boards. For example, last year Charles

made

Barack Obama's Christmas tree.
the art of the bodge how i made the emoji keyboard
And people could connect to the Internet to change the colors and patterns of the lights that went up and down. It was beautiful. And my job on the TV show was to be the bridge between the two, between Colin and Charles, so that the creations they physically made could interact with the world and with each other. So when we made a remote control for a horse (I'm not kidding, we made a remote control for a horse), Colin created the framework for a robot jockey and Charles created all the circuits and relays that pulled the reins. when the signals were received, and I created a smartphone app that allowed you to send these signals in order to control a horse.
the art of the bodge how i made the emoji keyboard
And it worked! And I probably had the easiest job of the three, because when I did things, I had an undo button. But the most important thing was this: we made prototypes. They had to work for 1 day of filming and we would be there for that. But they HAD to work that day or the .TV show would be terrible and we would have wasted a lot of money. And we didn't really have time to get there. We worked 16 hours a day, 7 days a week and at the end of production we ran out of time. We were bidding.
And the software that helped me during that program and beyond, more than anything, was called AutoHotKey. AutoHotKey is such a good tool that it is sometimes detected as a virus. Originally, AutoHotKey was intended to be very, very simple: it waits until a user presses a certain key and then starts a program, types a slightly longer text, or executes a more complicated series of otherwise very complicated

keyboard

commands. difficult. . Let's say you want the F10 key to make your game character suddenly turn 180 degrees and fire his gun. Good. No problem. AutoHotKey can take care of that. The thing is, AutoHotKey has grown and grown and grown.
And the programming language, what you have to write to make it work, is terrible. I mean really bad. It was meant to do very simple things, and over time it gained the ability to do much more. It can read files, look at the color of individual pixels on the screen, can call arbitrary Windows DLLs, and can parse regular expressions (for those who know what they are). But it's all in a strange, non-standard way, inspired by Visual Basic. AutoHotKey is a bodge that helps you create other bodges. But it works! And that means that instead of having to spend hours dealing with complicated things at the operating system level, you can simply write a few lines of script and AutoHotKey will do the rest.
I used AutoHotKey on the TV show to control the activation of a skydiver's parachute. And it worked. It works well! I mean, sure, we had a backup, but it worked. The most amazing trick I played on that TV show, and I swear I'm not lying, was a speech synthesizer and the Sibelius program on a Mac, controlled remotely by AutoHotKey on a Windows PC, crawling with a blind mouse. around, following a pattern of prerecorded movements sent over a remote desktop connection while another PC sent commands over Wi-Fi to a Google Chrome screen open on the Mac, because AppleScript and similar Mac tools we needed to run in Sibelius were simply not suitable for doing something so ridiculous.
By the way, if someone suggests using Linux... No. The world loves

emoji

s. Is seriously. Some people may not think so, of course. I don't really use them, despite the keyboard, but the world loves them. People click on titles about emoji. Just by placing the word in a headline you will get many more visits. Emoji is basically the Donald Trump of computers. There you have a joke that won't last long. Just the name itself is clickbait, you don't really need to add anything else. My friend Matt, who is now behind the camera, says hello to Matt Matt and I created an emoji-only messenger last year.
And almost no one used it. Hey. That is not true. Many people have used it... for about five minutes. Then they realized it was impractical and never opened it again. But you should see the media attention! All the emails we receive! There were even confused investors who thought it was a startup and emailed them to talk about stocks. So this year there were movie studios bidding on an emoji-based idea. Unfortunately it's not my idea, I wish I was the one who came up with that... Because they got almost a million dollars for it. The world is crazy about emojis and here it is: the concept of emoji as we know it today, as it is on this keyboard, is nonsense.
Maybe you know the story. Every language in the world has its own way of translating letters and binary codes (ones and zeros) for computers. However, Japan still has some leeway in its text encoding scheme. They already have many more letters than the Latin alphabet, so adding a few more is not really a problem. And then there's a smart engineer who thinks, "Wait, we can also put little images in our text encoding so we can allow people to send images without sending them, which typically consumes a lot of bandwidth. There are several competitors." versions of this, but they all remained in Japan until the Unicode Consortium was formed.
The Unicode Consortium's job is to figure out how each country encodes text in binary and merge all of these hundreds of different approaches into one global standard. The important thing about this is that for the most part they managed to do this, but Unicode was intended to be two-sided. You convert the text to Unicode and then convert it back to the old system your country used and nothing should have been lost. So the Unicode team goes to Japan and thinks, "Oh, you..." You have images in your text. Okay, um... "We can do something with that. We'll just add them to the standard as little glyphs. "Okay.
I already had an emoticon. No one will notice." And no one will really notice, for a while... Until Apple, which wants to sell iPhones in Japan, quietly adds emoji as a... pretty well-hidden option. But soon someone finds out; " Hey, I can send little piles of poop to my friends!" And all their friends are like, "Oh wow! How can you activate that?" And then suddenly you have a kind of ready-made viral explosion of piles of poop. Which is pretty noroviral, you could say. Then suddenly the world has emoji and America says: "What is this? For God's sake?" Because they're so used to making consumer electronics, text coding, everything in America, for America.
They have no idea what the cherry blossom seal is, or why there is a rice ball emoji, but not a burrito. AND They have no idea what a love hotel is. Don't ask, because remember, the originals were designed decades ago for Japan and there were originally between 100 and 150. Why. can't we have a burrito emoji? I think it's mainly an Apple thing, not an international standard. So the Unicode Consortium suddenly feels obligated to offer new emoji, so they have to offer cheats from all countries, so. which is actually a very clever approach because you actually send letters for abbreviations the countries, but that's a separate story Then they realize that all the phone manufacturers have made the default emoji yellow or just white and they have.
They offer something now known as skin tone modifiers. And let's be real: a family of one man, one woman, one boy, and one girl is incredibly stereotypical, so they made sure you can use something they called a "zero-width joiner" to get all the characters you like to join together. . forms a single-family emoji. You can do it on this keyboard with shift, something I'm very proud of. And yes, I know there will be someone who will respond, "Oh, it's political correctness gone mad." No. No. Get rid of it. Get rid of it. They are meant to be international.
They are intended to be cross-cultural, for all inhabitants of the earth. These damn options better exist, and luckily they do, sort of. But the emoji we have today were never designed to be global. They are a bodge upon a bodge upon a bodge. Cleverly made and standardized, that's for sure. But it is a mosaic of rules. It even contains Wingdings now. That's why there's a man in a suit floating there. Because it was an American decision. The latest version of iOS has a modified version on board. You could even add a more modern skin tone, but I'm not sure.
Then I came up with the idea of ​​making a physical emoji keyboard. I first thought about making a full Unicode version, but then I realized I would need hundreds and hundreds of keyboards. But you can fit all the 1200/1300 emoji that are currently available on about 14 keyboards. So here they all are. Printing the stickers correctly with my inkjet printer at home was quite difficult, but I managed it. It was a matter of lining everything up correctly and then spending hours gluing the damn things together. Fortunately, you can easily connect 14 USB keyboards to a Windows PC using USB hubs, and I'm like, "Yeah, okay.
Now I have 14 keyboards. That's great, but the problem is that the 14 keyboards, at least for 14 keyboards. most programs are considered the same keyboard. You can't see which Z key is pressed, only that a Z key is pressed somewhere. Even AutoHotKey, my trusted friend, couldn't help me with this. I started looking for other solutions. There are low level APIs (programming interfaces) in Windows that show you the raw input as it is sent over the wire... "All you have to do is plug the flip-flap stuff into the GKX port and then write -- "No. No. Then we're not going to do that.
Because I got to the point of installing Visual Studio and I was thinking about really learning how all this low-level stuff works and then I thought; "No. I use Windows. I'm sure someone has done this before. And sure enough, they were right. And among all this there is a program called LuaMacros, which is for the airplane simulation community. People who play airplane simulators They're great, they build entire cabins with a hundred different buttons so that everything is true to life. And if they can't afford it, then they want to be able to connect different keyboards so that they at least feel like they're in a fake cabin with a hundred buttons. that's why LuaMacros exists and it's great because it's basically a modified version of Lua, which is a strange programming language, but not too strange, with a bunch of additional functions built in to handle different keyboards AND because it is a language. full programming program, you can write entire programs with it. overjoyed.
I was literally dancing in my apartment when I downloaded and ran LuaMacros for the first time. That was partly because I was so happy and partly because I had Aqua's first album, but that doesn't matter. The program could detect individual keys from individual keyboards. Super! So this was the plan: write the code for each key. That is the code that is sent to the operating system when a key is pressed. Then put them all in a list, from top left to bottom right, on an entire keyboard. But ignore the complicated keys like Enter, Control, and Alt.
Then when a key is pressed, it takes that code, looks it up in the list, and remembers what position it is in. Add thatnumber to the total number of keys in the list multiplied by the number of the keyboard on which the key was pressed. So if I press the fifth key on the second keyboard, that would correspond to number 4 and keyboard number 1 on the list, because computers and programmers count from 0. So: fifth test; 0, 1, 2, 3, 4. Second keyboard: 0, 1. Put all these numbers in the formula and you will know where you are in the list. The reason we count from 0 is because it makes math a lot easier.
Keyboard 1, multiplied by 94 keys in the list, plus 4 means you want item 98 in the list, counting from 0. The equation is much simpler... and it didn't work. It didn't work. It took me half an hour to figure out why it wasn't working. And the reason it didn't work is because Lua, unlike any other modern programming language, counts from 1 and not from 0! Half an hour. That took me half an hour. I improved the equation and it worked. So I loaded the entire list of emojis in the order I pasted them on the keys and told LuaMacros: "When you get a key, calculate the number like we just did," look for that number in the big list of emojis. lower that number of lines "and type that emoji" And... that didn't work either, because there are no emoji keys on a normal keyboard, of course, not to create an emoji keyboard that will give them an emoji. a bit of bad language.
So what do you have to type special characters? Some of you will remember that. Hold down the Alt key and then enter numbers on the numeric keypad. That's not even from Windows. , IBM's BIOS and DOS, okay, it's decades old. But it still works. Because Microsoft is obsessed with backwards compatibility, you can still write this like it's the late eighties. But then they realized: " "Oh, now we have all these Unicode characters." so they used a bodge. They expanded it to Unicode. You make a quick adjustment to the registry, then you can type Alt, the plus sign, and then a Unicode code and then a Unicode character will be typed, including the emoji!
Hallelujah! So I got it working and put emojis in Microsoft Word. And I had to laugh. And then I tried the same thing in a browser, for example for Twitter, and it didn't work either. Because backward compatibility means that Unicode code points only work on text fields with rich formatting fields that support formatting, not just plain text. Several hours passed at this point. We almost arrive. I got quite frustrated. So I took a break. And I swear, at some point while I was making dinner it was like a light bulb went on over my head and the bodging gods shined on me and I screamed really loudly, "AutoHotKey!" Yeah, that wasn't just some dumb talk about clumsiness when I talked about AutoHotKey.
AutoHotKey. Since you can't see which keyboard is being pressed, it doesn't matter. What you can do is type emoji. You can search the emoji list. You can read a specific character from a line and enter it somewhere. Because it doesn't use keystrokes, but rather low-level Windows elements. So. I have a program, LuaMacros. It can read keyboards and determine which emoji the user wants. And I have the other program, that if we already know what emoji the user wants, we can write it. Then it was time to bid. This is how the keyboard works: you press a key.
LuaMacros intercepts it on entry, preventing Windows from typing the letter or whatever is underneath. Determine how many emoji you want and store this number in a file on disk. Then press the F24 key. Yes, there is an F24 key. It's not on my keyboard and it's almost certainly not on your keyboard, but it's still a key that Windows can use thanks to backward compatibility. AutoHotKey is listening for that F24 key and when it listens for it, it reads the file that LuaMacros created to store the number, looks for that number in the emoji list, and types this emoji.
This is how the emoji keyboard works and that's why I use Windows. And that is the art of bidding! One shot! Thanks Matt! Translated by Gilbert

If you have any copyright issue, please Contact