Inputify

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
❤x1
User
User
Posts: 46
Joined: Thu Jan 10, 2019 5:56 pm

Inputify

Post by ❤x1 »

Image Inputify

Hello!

I was screen sharing to teach a friend when I realized I used keyboard shortcuts without even noticing it.
Rather than working on my teaching skills, I decided to write a tool to alleviate the problem, and here it is : Inputify is a small program displaying your keyboard inputs on the screen.

Image

It's built with the almighty new C backend and comes with a few options : mouse input, light and dark mode and scaling.

Image

My PureBasic knowledge is rather limited, so there is probably much to optimize or clean up and, what a coincidence, it's open source and hosted on GitHub : https://github.com/LastLifeLeft/Inputify

I'll accept pull requests, bug reports and suggestions!

Oh, and a word of advice : don't forget Inputify on when you type a password while screen sharing. Not that I'd be clumsy enough to do that. 😓
User avatar
Tenaja
Addict
Addict
Posts: 1948
Joined: Tue Nov 09, 2010 10:15 pm

Re: Inputify

Post by Tenaja »

Thanks for sharing! That looks like a handy tool.
User avatar
NicTheQuick
Addict
Addict
Posts: 1224
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Inputify

Post by NicTheQuick »

Is there a Linux version available?
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
User avatar
❤x1
User
User
Posts: 46
Joined: Thu Jan 10, 2019 5:56 pm

Re: Inputify

Post by ❤x1 »

NicTheQuick wrote: Fri Nov 26, 2021 4:37 pm Is there a Linux version available?
I was waiting for the release of PB 6.00 for Mac and Linux to throw an eye on port, but it's rather API heavy and I can't guaranty anything.
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Inputify

Post by ChrisR »

It is very nice, thank you for sharing :)
It could be good with the keys written horizontally following the typing delay, as done for hotkeys like Ctrl+, Alt+...
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Inputify

Post by Kwai chang caine »

Very pro and nice work :shock:
Thanks for sharing 8)
ImageThe happiness is a road...
Not a destination
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: Inputify

Post by BarryG »

I was going to For/Next all the key definitions, but noticed some have different offsets. If they were all the same offsets (like the numbers 0-9), then those definitions can be shrunken down to just a few lines like this:

Code: Select all

; Numbers
For c='0' To '9' ; 48 to 57
  VKeyData(c)\Text = Chr(c)
  VKeyData(c)\Width = 60
  VKeyData(c)\Offset = 32
Next
Compare that to your existing definitions for numbers:

Code: Select all

;{ Numbers ( 48 to 57)
VKeyData(48)\Text = "0"
VKeyData(48)\Width = 60
VKeyData(48)\Offset = 32
VKeyData(49)\Text = "1"
VKeyData(49)\Width = 60
VKeyData(49)\Offset = 32
VKeyData(50)\Text = "2"
VKeyData(50)\Width = 60
VKeyData(50)\Offset = 32
VKeyData(51)\Text = "3"
VKeyData(51)\Width = 60
VKeyData(51)\Offset = 32
VKeyData(52)\Text = "4"
VKeyData(52)\Width = 60
VKeyData(52)\Offset = 32
VKeyData(53)\Text = "5"
VKeyData(53)\Width = 60
VKeyData(53)\Offset = 32
VKeyData(54)\Text = "6"
VKeyData(54)\Width = 60
VKeyData(54)\Offset = 32
VKeyData(55)\Text = "7"
VKeyData(55)\Width = 60
VKeyData(55)\Offset = 32
VKeyData(56)\Text = "8"
VKeyData(56)\Width = 60
VKeyData(56)\Offset = 32
VKeyData(57)\Text = "9"
VKeyData(57)\Width = 60
VKeyData(57)\Offset = 32
;}
User avatar
❤x1
User
User
Posts: 46
Joined: Thu Jan 10, 2019 5:56 pm

Re: Inputify

Post by ❤x1 »

BarryG wrote: Sat Nov 27, 2021 12:33 amthose definitions can be shrunken down to just a few lines
All those definitions got generated automatically, so I did not even read them... And damn! Applied wherever it was possible, that's about 150 lines saved!
Many thanks. 👍
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: Inputify

Post by BarryG »

No problem; glad I could help. Not sure if you're aware that wrapping a single character in apostrophes will make PureBasic convert that character to its Asc() code at compile time? It makes your source more readable, like the below, and you also don't need to remember the Asc() numbers for the loop.

Both lines do exactly the same thing when compiled, but the "Better" way makes it more obvious with no comments needed.

Original: For n = 48 To 57
Better: For n = '0' To '9'

Original: For l = 65 To 90
Better: For l = 'A' To 'Z'
User avatar
❤x1
User
User
Posts: 46
Joined: Thu Jan 10, 2019 5:56 pm

Re: Inputify

Post by ❤x1 »

BarryG wrote: Sat Nov 27, 2021 9:15 am Not sure if you're aware that wrapping a single character in apostrophes will make PureBasic convert that character to its Asc() code at compile time?
I definitively didn't know that. Thanks again!
ChrisR wrote: Fri Nov 26, 2021 7:37 pm It could be good with the keys written horizontally following the typing delay, as done for hotkeys like Ctrl+, Alt+...
I gave it a try, and it adds some readability issues : we need more space between each input window to get a clear separation, and more movement doesn't help either. So, I won't implement it, sorry.
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Inputify

Post by ChrisR »

❤x1 wrote: Sat Nov 27, 2021 10:56 am I gave it a try, and it adds some readability issues : we need more space between each input window to get a clear separation, and more movement doesn't help either. So, I won't implement it, sorry.
It was just a suggestion, it's beautiful the way it is, especially if you've already tried it.
It can be helpful, to show the shortcuts used CtrL+C, Ctrl+V,... when connecting to remote computers, training, demo,...
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 538
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

Re: Inputify

Post by Sicro »

Thanks for the very useful tool! 8)
❤x1 wrote: Fri Nov 26, 2021 3:51 pmhosted on GitHub
Yeah, very nice!

Yes, Linux version would be very good. When I have enough time, I will try if it works with Wine under Linux, but a native Linux version would of course be better. Maybe helpers can be found.
Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
Mr.L
Enthusiast
Enthusiast
Posts: 104
Joined: Sun Oct 09, 2011 7:39 am

Re: Inputify

Post by Mr.L »

Hi, ❤x1!
Inputify looks very nice, thanks for sharing!
OgreVorbis
User
User
Posts: 77
Joined: Thu Jan 16, 2020 10:47 pm

Re: Inputify

Post by OgreVorbis »

What are you using for the UI? If I saw that, I would have guessed it was an embedded web app.
Are those just image gadgets that toggle or are they animated controls?
My blog/software site: http://dosaidsoft.com/
User avatar
❤x1
User
User
Posts: 46
Joined: Thu Jan 10, 2019 5:56 pm

Re: Inputify

Post by ❤x1 »

OgreVorbis wrote: Wed Dec 01, 2021 4:32 am Are those just image gadgets that toggle or are they animated controls?
Plain and simple vector drawn canvas, sorry.
I thought of using a webview, but the one available within PB seems ancient (gave me a lot of js error) and importing a modern one was way out of scope for such a small project.
Post Reply