Devlog 6
- My this session was so exciting that i only stopped because I reached the
10 hour limitof thehackclub. - Well, I think throughout this project, I have been doing things which I don’t understand, things which were boring
- but right now this is the point when everything clicked, finally got the hang of
RUST
Its gonna be long Devlog read at your own risk(10 hours dump. Note: the maximum limit is 4000 characters so I cannot write everything here just this much)
1. Crazy things this time
So if you may know that in this project, one of the things is to simulate the actual keyboard through the application
Here is a interesting thing i found about special fucniton keys
- those special functionalities keys work strangly, on
MacBook, we pressF1to decreasebrightness, so i coded my applicaiton to to press theF1but nothing happened - in reality, most
OSdo not registers theF1andF2key for changing thebrightnessbut it actually uses some code tied tohardwareto trigger the special fucitionality
How did i solve this?
- well, I read about how actually a
Operating systemsregister the keys, and trigger those special functions.
And this was the reason pressing theshortcutswere not triggering those special functionalities into the computer. As theOSwas not looking for me to pressF1. it looks for aspecial codewhich is tied with thekeyboarditself, which was not invirtual keyboard, - solution is simple. You have to find out what
codeis used by a particularoperating systemto increase or decrease thebrightness, and then you will have to trigger thatcodewhen the key is pressed.
2. Macros
I implemented macros, you can basically press a sequence of keys with control delay. Just on a single click. It is spamming a key running some keyboard shortcuts on a single click.
- I created different
threadto run thismacroso that it does notfreezemy main application - this is the point which like frustrated me for very long as it is been like three years when I learned
concurrencyandthreadinginPythonand I did it again inrustthis time. I usedMPSC (Multi-Producer, Single-Consumer)here. I don’t fully understand it, though, but yeah, I know why I used it and how I used it
3. App Lanucher
So I just liked a button, which upon clicking will open up any application on your computer
- but the main thing was not actually opening the application, it was which application to open, Open an application by running a
commandonoperating system, you have to know their exactofficial names, and a normal user does not know that - so, I scanned the whole
application folderonto theoperating systemand found out theofficial namesof each application. Then I showed the list in adropdownto user, from where user can select the names of applications.
-well, it took me a lot of time because this was my third approach which worked my initial implementaion were like I would force the user to open up that application and then my application can register it, but obviously, the above approach is better than this, so I dropped it.
Jupiter (idk, maybe because its big, and who doesnt like sloar system?)
4. Context Aware Layouts
This is it. The big one. This was the most important, most time-consuming, and absolute flagship feature of the entire project.
- so, what is
context aware layouts? So in the application, one of the parts is to createlayouts, which helps with your work aespecially in theproductivity/professional applications - so lets say you are coding or working, constantly shuffling between multiple
desktop apps, with your phone sitting on your desk acting as your custommacro pad. This feature actively extracts the currently focused application on your computer and instantly switches thelayouton your phone to match it.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.