[Script] KeypressOSD - Display key press on screen

Post your working scripts, libraries and tools
robodesign
Posts: 133
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
Contact:

Re: [Script] KeypressOSD - Display key press on screen

13 Oct 2017, 11:45

Hello, again!

New version is here. Drugwash, the feature you requested is here: Shift+Symbols/Numbers yield correct chars on the OSD, but only for English now :). Support for other layouts is scheduled.

; by Marius Sucan (robodesign.ro)
; v2.95 (2017-10-13)
; - fixed counting related issues
; - it now shows Shift+[numbers/symbols] ; many thanks to phaleth and the great folks on #ahk
; - error handling for missing non-English keyboards definitions file

Sources at:
AHK file:
; http://marius.sucan.ro/media/files/blog ... ss-osd.ahk

Language definitions, new version. Must be downloaded!
; http://marius.sucan.ro/media/files/blog ... guages.ini

; TO-DO:
; features to implement:
; - multilanguage support for Shift+(symbols/numbers) done
; - after pressing Shift + [letter] if the following key is a single letter, remember the first Shift + [letter]; done
; - visual mouse clicks and highlighter/locator done
; - tray menu or window with options/settings done
; - text caret locator/highlighter
; - show a generic symbol for ignored dead keys; helps to clarify one was pressed;
; - window spy, get texts underneath the mouse

Best regards, Marius.
Last edited by robodesign on 29 Oct 2017, 06:22, edited 1 time in total.
User avatar
Drugwash
Posts: 309
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: [Script] KeypressOSD - Display key press on screen

13 Oct 2017, 14:01

Thanks for your continuous work, Marius. Since I only have a RO layout I'll be waiting for an updated version. Good luck! ;)
robodesign
Posts: 133
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
Contact:

Re: [Script] KeypressOSD - Display key press on screen

14 Oct 2017, 13:57

Hello!

My pleasure. Here is a new version:


Sources at:
AHK file:
; http://marius.sucan.ro/media/files/blog ... ss-osd.ahk

Language definitions, new version. Must be downloaded!
; http://marius.sucan.ro/media/files/blog ... guages.ini

; by Marius Sucan (robodesign.ro)
; v2.97 (2017-10-14)
; - new shortcut: Pause/Break, to suspend/resume the script
; - added support for 12 keyboard layouts when pressing Shift + [numbers/symbols]
; - added support for a new keyboard layout: Croatian
; - after pressing Shift + [letter/symbols], you will get into typing mode
; - Shift + [numpad keys] works now somehow, somehow, still glitchy/quirky, but better than nothing...

; TO-DO:
; features to implement:
; - add more layouts for Shift+(symbols/numbers) done
; - visual mouse clicks and highlighter/locator done
; - tray menu or window with options/settings done
; - text caret locator/highlighter
; - show a generic symbol for ignored dead keys; helps to clarify one was pressed; done
; - window spy, get texts underneath the mouse

Best regards, Marius
Last edited by robodesign on 16 Nov 2017, 05:17, edited 2 times in total.
robodesign
Posts: 133
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
Contact:

Re: [Script] KeypressOSD - Display key press on screen

15 Oct 2017, 10:35

Hello!

New version, everyone.

; CHANGELOG:
;
; by Marius Sucan (robodesign.ro)
; v2.98 (2017-10-15)
; - added support for another 12 keyboard layouts when pressing Shift + [numbers/symbols]. About 20 still to go.

AHK file:
; http://marius.sucan.ro/media/files/blog ... ss-osd.ahk

Language definitions, new version. Must be downloaded!
; http://marius.sucan.ro/media/files/blog ... guages.ini

Best regards, Marius.
User avatar
Drugwash
Posts: 309
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: [Script] KeypressOSD - Display key press on screen

16 Oct 2017, 09:55

Thank you for the improvements.

There's an old issue with the default timer: the OSD goes away much too fast, can't read what's been typed. At times it dissapears exactly when pressing a key instead of prolonging the timeout period. At script start I can't get to see the current layout, maybe the OSD should stay on until the user (right-)clicks it.

Now it needs special treatment for AltGr combinations (on RO layout and probably others). For example AltGr+ă=÷ and AltGr+î=×, but most importantly AltGr+q=\, AltGr+w=|, AltGr+b={, AltGr+n=} and a few others (see previously mentioned OSK screenshots on my blog). Actually AltGr is exactly the same as Ctrl+Alt, at least for RO layout (in XP).
robodesign
Posts: 133
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
Contact:

Re: [Script] KeypressOSD - Display key press on screen

17 Oct 2017, 02:57

Hello!

Quote "here's an old issue with the default timer: the OSD goes away much too fast, can't read what's been typed. At times it dissapears exactly when pressing a key instead of prolonging the timeout period. At script start I can't get to see the current layout, maybe the OSD should stay on until the user (right-)clicks it. "

It stays visible by default for 3 seconds. Each key press prolongs its visibilty timer. However, if it hides when you type, it means your mouse is on top of it :). This is a feature :) ... I made it to hide when the mouse hovers/runs over it, because I do not want it to get in the way of doing things.

My skills are limited and I am unable to cover aspects about AltGr + [letters]. My apologies. Maybe other people can implement this feature. I will add it to the to-do list, for others.

Best regards, Marius
robodesign
Posts: 133
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
Contact:

Re: [Script] KeypressOSD - Display key press on screen

17 Oct 2017, 14:14

Hello, again!

A new version is here.

; CHANGELOG:
;
; by Marius Sucan (robodesign.ro)
; v2.99 (2017-10-17)
; - automatic download of the language definitions file, if the file is missing
; - added support for another 10 keyboard layouts when pressing Shift + [numbers/symbols].

Now, all supported languages include Shift + [symbols/numbers] . That is, full support for 50 layouts.

AHK file:
; http://marius.sucan.ro/media/files/blog ... ss-osd.ahk

Language definitions, new version. (it will be downloaded automatically)
; http://marius.sucan.ro/media/files/blog ... guages.ini

; TO-DO:
; features to implement:
; - show letters/chars generated by AltGr+[keys]; done
; - visual mouse clicks and highlighter/locator; done
; - tray menu or window with options/settings ; done
; - check for updates as an option; done
; - on first start, save all settings in the INI; done
; - text caret locator/highlighter
; - show a generic symbol for ignored dead keys; helps to clarify one was pressed; done
; - window spy, get texts underneath the mouse
; - errors journaling
;
; glitches to fix [by priority]:
; - quirky Shift + [numpad keys]
; - [minor bug] once a key is pressed, counting of key fires is not initiated after the OSD was hidden for a little awhile; done/fixed
; - make dead keys work better, even detect them ; done
; - automatic resizing of the OSD/GUI is just a silly hack based on the default font size and the number of typed chars; it often fails to resize properly; done/much improved
; - redraw issues; it still flickers;
; - make it work reliably with sticky keys; if user presses once Ctrl and another key afterwards, it rarely detects the combination on Winndows 7;


Best regards, Marius.
Last edited by robodesign on 16 Nov 2017, 05:19, edited 4 times in total.
User avatar
Drugwash
Posts: 309
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: [Script] KeypressOSD - Display key press on screen

18 Oct 2017, 03:14

robodesign wrote:It stays visible by default for 3 seconds. Each key press prolongs its visibilty timer. However, if it hides when you type, it means your mouse is on top of it :).
Unfortunately that is not the case, the cursor is far away from the OSD and still times out very quickly or fails to show up when typing. Minutes ago I just discovered a different issue (which may be the same!) as seen in the screenshot: OSD is being partially cut at the top. This may be related to my browser (QtWeb 3.8.5 build 108) unless there's a hidden keylogger or something similar running on my system. :shock:
weird OSD issue.png
(102.92 KiB) Not downloaded yet


robodesign wrote:My skills are limited and I am unable to cover aspects about AltGr + [letters]. My apologies. Maybe other people can implement this feature. I will add it to the to-do list, for others.
It should be the same as with Shift and numbers. Either AltGr or Ctrl+Alt, it's the same, they output the same characters. Admittedly it would complicate the script but they're really needed. Well, if you can't do it maybe someone else would chime in with a solution. I'm still away from coding, working in the garden these days.
Cheers! :wave:
robodesign
Posts: 133
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
Contact:

Re: [Script] KeypressOSD - Display key press on screen

18 Oct 2017, 03:29

Yes, I could do something as I did for Shift. Another table of chars, for AltGr. However, I think all this is Sisyphus kind of work. All these tables could be replaced by various DLL calls and APIs from Windows.

I have no Windows XP to test. I think you have redraw issues, hmmm... Change this line:

Gui, +AlwaysOnTop -Caption +Owner +LastFound +ToolWindow +E0x20

Remove +E0x20 or change it with another style to suit your OS. Please return with your observations.

Best regards, Marius.
User avatar
Drugwash
Posts: 309
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: [Script] KeypressOSD - Display key press on screen

18 Oct 2017, 04:29

Yep, I know it would be hard work. Won't repeat why. ;) Just do what you can.

Removing the extended style from the GUI improves the display, doesn't dissapear early anymore and is also not getting cut off anymore. Good find! :thumbup:

I just posted a modified script for the ripple effect to accomodate your needs (and more). Enjoy! :wave:
robodesign
Posts: 133
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
Contact:

Re: [Script] KeypressOSD - Display key press on screen

19 Oct 2017, 05:29

Quick update: I am making good progresses with Visual mouse clicks feature. I am implementing my own version, without using the Ripple Effect script
User avatar
Drugwash
Posts: 309
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: [Script] KeypressOSD - Display key press on screen

19 Oct 2017, 11:03

That's fine, I'm very busy these days anyways, dunno when/if I'll get to test that combination.
Good luck with the new feature(s)! ;)
robodesign
Posts: 133
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
Contact:

Re: [Script] KeypressOSD - Display key press on screen

20 Oct 2017, 05:28

Hello!

Thank you. We should get in contact, Drugwash. Whatsapp, Facebook or something. Message me in private if you are interested.

Today is one month since I began working on the script. I finished implementing visual mouse clicks feature.

; by Marius Sucan (robodesign.ro)
; v3.00 (2017-10-20)
; - [new] visual mouse clicks and idle mouse highlighter/locator

; TO-DO:
; features to implement:
; - show letters/chars generated by AltGr+[keys]; done
; - tray menu or window with options/settings; done
; - check for updates as an option; done
; - on first start, save all settings in the INI ; done
; - text caret locator/highlighter
; - window spy, get texts underneath the mouse
; - errors journaling?

Download AHK file from:
http://marius.sucan.ro/media/files/blog ... ss-osd.ahk

Best regards, Marius.
Last edited by robodesign on 16 Nov 2017, 05:21, edited 2 times in total.
User avatar
Drugwash
Posts: 309
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: [Script] KeypressOSD - Display key press on screen

20 Oct 2017, 12:16

I'm almost retired from the (anti-)social web, been here for too long. All I got left are two e-mail addresses, everything else got deleted in time. I'll PM you soon, now I'm broken and pi$$ed off for some private reasons, need a beer and some rest. Keep up the good work!
robodesign
Posts: 133
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
Contact:

Re: [Script] KeypressOSD - Display key press on screen

22 Oct 2017, 14:39

Hello, ppl!

Here's a new version. I fixed some bugs and defined a personalized system tray menu.

Settings window will come soon, along with Help and About.

; CHANGELOG:

; by Marius Sucan (robodesign.ro)
; v3.04 (2017-10-22)
; - [new] an option to disable typing mode
; - [new] volume buttons show master volume level
; - [new] tray menu with options [settings window, coming soon™]
; - minor bug fixes
; v3.01 (2017-10-21)
; - bug fixes related to visual mouse clicks
; - added support for Capture2Text. Shortcut for this: Alt+Pause/Break
; - requires Capture2Text with shortcut set to Pause/Break


I might also implement AltGr support. I am thinking how to do it, but first the settings window.

Download AHK file from:
http://marius.sucan.ro/media/files/blog ... ss-osd.ahk

Image

Best regards, Marius.
Last edited by robodesign on 23 Oct 2017, 12:38, edited 1 time in total.
robodesign
Posts: 133
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
Contact:

Re: [Script] KeypressOSD - Display key press on screen

23 Oct 2017, 11:20

Hello!

And now.... another new version:

; KeyPress CHANGELOG:

by Marius Sucan (robodesign.ro)
v3.10 (2017-10-23)
- [new] highlight the mouse cursor with a halo
- [new] options to configure colors and sizes for OSD and mouse highlighters
- [new] force keyboard layout and a shortcut to change between two kbd layouts
- [new] about and version history; the change log is now an external file
- error handling for missing Capture2Text application
- tray menu indicates detected keyboard layout.
- [minor bug fix] .ini file naming

Download AHK file from:
http://marius.sucan.ro/media/files/blog ... ss-osd.ahk

Image

Settings window... soon ;-)

Best regards, Marius
robodesign
Posts: 133
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
Contact:

Re: [Script] KeypressOSD - Display key press on screen

26 Oct 2017, 12:27

Hello people!

New version is ready. After intense work, I managed to finish the settings windows and tray menu for this script.

It uses now an INI file to store all settings, it is created at first start.

I hope people can now use it with much more ease.

Download AHK file from:
http://marius.sucan.ro/media/files/blog ... ss-osd.ahk

CHANGE LOG
by Marius Sucan (robodesign.ro)
v3.20 (2017-10-26)
- [new] settings windows: keyboard, mouse, appeareances
- [new] toggle position on mouse hover
- [new] show border around OSD
- [new] option to change the space bar char from underscore to what you desire
- various improvements and fixes

v3.16 (2017-10-25)
- work on the preferences windows
- various improvements and fixes

v3.15 (2017-10-24)
- typing in OSD is now more responsive when key or caps beeps are enabled
- fixes related to typing with capslock on and using shift
- created settings windows for Keyboard, Mouse and OSD

Best regards, Marius.
User avatar
hoppfrosch
Posts: 304
Joined: 07 Oct 2013, 04:05
GitHub: hoppfrosch
Location: Rhine-Maine-Area, Hesse, Germany
Contact:

Re: [Script] KeypressOSD - Display key press on screen

26 Oct 2017, 23:38

8-) It's getting better and better ... :thumbup: :thumbup: :thumbup:
robodesign
Posts: 133
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
Contact:

Re: [Script] KeypressOSD - Display key press on screen

27 Oct 2017, 03:27

yes, indeed; i fixed some bugs since last evening; just updated the ahk files

i plan to make more improvements, even to keyboard support
User avatar
joedf
Posts: 6015
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: [Script] KeypressOSD - Display key press on screen

27 Oct 2017, 08:53

hoppfrosch wrote:8-) It's getting better and better ... :thumbup: :thumbup: :thumbup:

The feature missing is for it to pay bills and tuitions hahaha :lol: :+1:

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 12 guests