[Script] KeypressOSD - Display key press on screen

Post your working scripts, libraries and tools for AHK v1.1 and older
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

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

21 Nov 2017, 13:47

Just tested, Romanian, Ukrainian, Russian, Spanish, no issues so far at all in Win7!
Sound files downloaded without issue also.
Very nice indeed, thank you!
Regards,
burque505
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

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

21 Nov 2017, 16:12

Thank you. Great to hear.... in my plans, next are [in no particular order]: multi-monitor support [it is partially done already], attempt again to implement support for caret navigation jumps [ctrl+keys] and... the help menu ;).

Oh, and add complete support for another 40 keyboard layouts. Until now, I only have for 30.

Of course, meanwhile, fix any bugs you guys discover or I encounter myself.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
User avatar
Drugwash
Posts: 850
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

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

22 Nov 2017, 08:06

Confirmed Burque's report, so far testing (v3.54, Romanian keyboard only) was succesful. Great job!
One thing I stumbled into is a bit tricky: I renamed the running script and upon applying or dismissing a settings window it displays an error message box stating "Script file not found: <former script name>", which technically is correct but too "dry". Maybe you could wrap the reloading routine into a try/catch pair and on failure offer a 'File open' dialog where the user could choose to load the renamed file or some other version, if exists.

One feature request while I'm at it: please add an option to the sounds panel to disable the exit jingle. :)
Part of my AHK work can be found here.
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

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

22 Nov 2017, 11:28

hehe, great to hear you like it!

Download AHK file from or use the Update now option:
http://marius.sucan.ro/media/files/blog ... ss-osd.ahk

New version and change log:
v3.54 (2017-11-22)
- now both Enter and Escape keys erase [or not] typed text in the OSD
- minor bug fixes, including one related to dead keys
- added complete support (Shift, AltGr and dead keys) for several Azerbaijani and Latvian keyboards

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

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

23 Nov 2017, 13:15

Hi, again!

Today's change log:

v3.55 (2017-11-23)
- minor bug fixes and improvements
- added complete support (Shift, AltGr and dead keys) for several Croatian, Serbian, Slovenian, Danish, Finnish, Norwegian, Swedish and Greenland keyboards...

20 keyboard layouts left to implement.

Best regards, Marius
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

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

23 Nov 2017, 16:20

Hi Marius, thanks once again, working just fine for me. I really like the update feature.
Regards,
burque505
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

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

23 Nov 2017, 17:14

Hello!
Great to hear that!

I started also working on the help contents.

As a side note, regarding updates.... , up until version 3.28, the update function was buggy and it often failed.

Up until version 3.51, the automatic download of language definitions file had a bug which caused it, sometimes.... to reload constantly, unstoppable..... I apologize if any of my readers here have encountered this problem. I hope that the newer versions no longer have this bug.

If any of you have problems with this script, please report it to me. I want to make sure that I fix really annoying bugs.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

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

23 Nov 2017, 17:40

@Burque505.

Could I use this script to capture text on screen?

https://autohotkey.com/boards/viewtopic.php?f=6&t=17834

I would like to have an option in my script that allows the user to capture text underneath the mouse cursor and display it large, in the OSD.

Thank you.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

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

23 Nov 2017, 19:03

Hi Marius, that is a great script but I think it is more for finding coordinates of text/images on screen, like for automating web pages, than what I think you're looking for.
How about scuttlegun's great GDIP magnifier? You can find it here.
Regards,
burque505
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

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

24 Nov 2017, 14:33

Hello!

A new day, a new version....

Download AHK file from or use the Update now option:
http://marius.sucan.ro/media/files/blog ... ss-osd.ahk

CHANGE LOG:
v3.56 (2017-11-24)
- [new] visual indicator for capslock turned on
- [new] support for Ctrl+V [paste]
- much improved Page Up/Down behaviour when typed history is enabled
- added complete support (Shift, AltGr and dead keys) for several Swedish / Finland (Sami Extended), Norwegian (Sami Extended), Estonian, Icelandic, Italian, Polish and Slovak keyboard layouts.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

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

25 Nov 2017, 12:54

Hello!

I finished going through all the initial keyboard layouts. Now I have full support for 72 keyboard layouts. However, as burque505 suggested, the script handles fine Cyrillic . Therefore, I plan to add around 15 keyboard layouts, some of these will be with Cyrillic and Greek alphabets.

v3.57 (2017-11-25)
- important bug fixes related to layouts ;)
- the dead key symbol is not anymore generic; symbols such as ^,~,` ... are displayed in the OSD
- added complete support (Shift, AltGr and dead keys) for several Dutch, Hungarian and Lithuanian keyboard layouts.

Download AHK file from or use the Update now option:
http://marius.sucan.ro/media/files/blog ... ss-osd.ahk


Best regars, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

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

25 Nov 2017, 13:28

Hi Marius, it appears Spanish is no longer working for all keys.
¿ is registered as superscript 1 in typing mode, ? is registered as a double-quote.
¡ is fine. ñ is fine. = registers as ). ) registers as (. ( is now *. / is now &. & is now ^. % is fine. $ is fine. · is now #. " is now @. ! is fine.
@, or Ctl-Alt-2, does not register. |, which is Ctl-Alt-1, is fine. #, Ctl-Alt-3, does not register. €, Ctl-Alt-5, does not register. ¬, Ctl-Alt-6, does not register.
Can't type é or è at all, it kills both in the application as well (looks like it kills the dead keys - no pun intended :D ).
And so forth. I'll keep testing.
Regards,
burque505
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

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

25 Nov 2017, 15:07

I am sorry to hear this.... tell me exactly the keyboard layout, the code from Typing mode window.

What I changed in this version should not be related to Spanish, but other keyboards.... More specifically, the changes are in function: SpecialSC(sc). I use it for keys that AHK doesn't bind on my computer. I had there a list of Scan Codes [SCs] and Virtual Keys [VKs] of such keys . On some keyboard layouts, one or two keys are not binded/bond. I don't know why. It doesn't work by name to bind these, just by scan codes.... . In the past, I decided to specify each SC/VK for each key that was missing. I associated SC/VKs to specific key names/symbols. For example: I had sc052vkDE, show @. However, many keyboards use the same SC/VK for different symbols/chars which made stuff complicated.

Today, I had the idea to just name the SC/VK to bind but not specify what character it is. I use GetKeyName() of SC/VK. This gets the name/symbol of the key I press. I no longer have to specify for each layout what the SC/VK symbol is. On my system it works fine.

Returning to Spanish, in my script, I defined only 3 layouts specific to this language and these have no special SC/VKs, because all keys are recognized, on my system. Therefore, the change I made should not affect it. In other words, for these three layouts it does not make use of SC/VK converter to display any key.

However, I might have another regression I am not aware of.

I just tested the Spanish layouts I have and it all seems fine, for me, here. Perhaps you might have an app interferering, or another script.

Please make sure you have the latest version. I uploaded the right files after 30 mins I posted announcing the new version. I accidentally uploaded the wrong files, hehe. What you describe sounds like having the wrong definitions file. Judging by what time you posted, you had the wrong files.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

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

25 Nov 2017, 18:04

Hi Marius, from the Typing mode window it always displays 00000409, unless I check Monitor Keyboard Layout, and then it will flash back and forth from kbd0409 to 0x40A0C0A until I start typing. When I stop it flashes again. The same problem I had before is still there. In Russian now +_)(*?:%;№"! + --- '?', displays as '&', ':' displays as '^', ';' displays as '$', '№' displays as '#' (makes sense), '"' displays as '*'.
Regards,
Winter
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

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

26 Nov 2017, 03:48

This is Windows 7 ? Afaik, yes; I am aware there's a bug with Monitor keyboard causing it to reload/flash constantly.

I did not implement yet the support for Russian layouts. I will do that soon. As I stated earlier / in previous posts, I will do so, soonish.

Are the Spanish layouts still broken for you?

Thank you very much.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
User avatar
Drugwash
Posts: 850
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

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

26 Nov 2017, 05:27

Quick test here (same Romanian legacy 0418 on XP), a few minor things I noticed:
- after succesful update (upon request) and even after restart, the settings file is not updated with the current version and releaseDate.
- something fishy with Shift+6: at first press it displays an underscore and on second press it displays the correct character '&'. If I don't press it twice the underscode will remain in the OSD instead of the '&', being combined with whatever character was typed next. All other Shift combinations work as expected displaying the character at once (except maybe for Shift + Numpad but that's to be tested in depth some other time since I'm not familiar with their default actions).
- misspelling in the Sounds control panel: All binded keys --> All bound keys
- typo in the Keyboard control panel: Continously detect […] --> Continuously detect […]

Also the mouse halo/flash are still off and weird on XP as previously reported.
Otherwise no major issues so far, but it wasn't a thorough test.

A suggestion: since automatic toggling of the OSD position may be disturbing or disconcerting, and having it dissapear on hover might not always be desirable, I'd like an option to have it instantly draggable to any position on any screen while retaining the display timeout (maybe plus the drag time if it took a while to reposition it). That may be also combined with an extra option to never hide the OSD.

There's a neat albeit more complicated trick to invoke the color picker without separate buttons, usable in the OSD Appearance panel: a ListView with no header and a combination of other styles, with background color set by the color picker, that calls it through its gLabel. RGB colors must be reversed though when invoking/setting. I see you're using Progress controls and Buttons for that, because the Progress is officially non-clickable in AHK. An example of the ListView usage can be seen in my VolOSD settings panel when 'Obey OS theme' is disabled, and also clickable Progress (as a proof of concept) is used in the mini-panel that appears when single-clicking its tray icon. Not sure if it's worth the bother though and more than that I'm not sure it'll work (correctly or at all) on a Win10 (possibly x64).
Part of my AHK work can be found here.
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

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

26 Nov 2017, 08:49

Hi Marius, sorry I didn't say that before. Spanish is still not working. The real problem there is that it kills the dead keys, so I can't even type ó, ò, é, ö, ô, è, í, and so on, the OSD aside.
I like Dragoș's idea about being able to drag the OSD and maybe disabling hiding it.
All this aside, apart from Spanish it's still really quite useable. Thanks as always for your dedication and tireless work on this.
Regards,
burque505.
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

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

26 Nov 2017, 11:20

Hello, guys!

@Drugwash: The symbol & is not displayed on XP at first because it uses the old display mode. You said it flickers more when it's a Text field control. On XP it's a plain text control where & underlines the next character.

Shift + [numpad keys] does not work with AHK :-).

The INI file updates only when you use the exit command or when you change something at preferences.

I will think about your suggestions. Thank you ;-).

@burque: please test the new version... It is imperative that I fix that bug.

In 30-90 minutes I am posting the new version.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

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

26 Nov 2017, 12:24

Hello, guys!

Here's the new version:

v3.58 (2017-11-26)
- changed how dead keys are displayed in the OSD
- fixed a major bug related to dead keys
- fixed typos reported by Drugwash
- better support for multi-monitors
- added complete support (Shift, AltGr and dead keys) for Turkish, Yoruba, Maori, Igbo, Hausa and Guarani keyboard layouts.

Download AHK file from or use the Update now option:
http://marius.sucan.ro/media/files/blog ... ss-osd.ahk

@burque505: Please test this version with Spanish.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

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

26 Nov 2017, 12:43

Hi Marius, just updated. Still can't type accents on keyboard Spanish (Spain - International Sort), Win7 64-bit. What I mean by that is, not only do the accents not show up on the OSD, they also don't show up in whatever application I'm typing in. As soon as I stop the script, I can type the accents again. The previously reported problems with Shift+[1-0, -=] are still there also.
Regards,
burque505

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: hiahkforum and 59 guests