Accessibility software: listen for keypress and play audio file of matching character

I'm coming from Python (a rather weak base knowledge, just micropython/circuitpython for some hardware I've made some clients.)

I would like to make a tiny systray application that runs silently in the background listening for keypresses, so that when someone types "A" it would then play "a.wav" on the speakers and so on for each letter and number.

I have developed a weak proof of concept in (badly written) Python, which is available here for review if you would like to understand what I'm getting at briefly: alpha_reader.py ยท GitHub

It does work, but I would like the entire application encapsulated in a single .exe file. I've never made a software package before, so things like compiling assets in such as icons or audio files is new and exciting for me. I would like for this to be a single .exe to simplify the tech support side of things. It would simply run at boot time via the startup folder on Windows.

I've found the following crates to assist me:

device_query = "0.2.8"
trayicon = "0.1.3"

I have not begun significant development of this.

I do have 1.wav...5.wav...9.wav/a.wav...b.wav...z.wav etc etc readily available in a pretty sounding and LGPL licensed archive I would like to utilize. I also have a .ico file for the trayicon.

Please let me know if I'm on the correct path with Rust. I am learning my first real compiled language with Rust (with limited Arduino experience) and would like very much so to have an application at the end of this learning experience that can run in the background without bloating memory unnecessarily as it will run for weeks or months at a time between reboots on a much older desktop computer.

Sorry, but what is your question?

Just wondering if this is something that is best done with Rust or if I'm shooting myself in the foot with this so far.

For the task you have at hand, almost any language will do it just as well. The only considerations you may need to have are:

  • Whether you need some specific library and if it is available for that language (or you can roll your own if you're feeling like it).
  • Whether you are comfortable with the language

Of course, you can use a project to learn a language, in which case you'll have to struggle your way through it (and ask for help when you hit a wall). Otherwise you can simply decide that you want the end-product fast, in which case it's better to stick with whatever language you want.
For example, I am comfortable enough in Rust or C++ to write about almost anything in it. But, of late I am trying to write some things in Haskell - it's not comfortable or fast (as in development speed) and the code is sure to make an expert Haskelleer gag. That is the point, struggle and learn and eventually I hope to become as comfortable in Haskell as I am in Rust.
So take your pick....

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.