[Script] KeypressOSD - Display key press on screen

Post your working scripts, libraries and tools
User avatar
Drugwash
Posts: 448
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

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

22 Jan 2018, 14:13

MUI names should always be retrieved except for custom layouts that don't have such names defined.
Substitutions worked fine here with my test script although one of them was guesswork. Could you please export, pack and attach (here or on PM) the Preload and Substitutes subkeys from your Win10 registry for me to analyze? I need to find the original logic behind those things.

Last night I found a way to detect active window change without a timer but I'm not yet sure it'll work for all kinds of windows, it's not thoroughly tested.

Today I've been working on a key detection script, both normal and dead keys. It mostly works except for one dead key in the Greek Polytonic layout which is not detected as dead key but as normal key. Dunno why, the official OSK does recognize it as a dead key. Maybe I'm doing something wrong or there's a bug in some API I use. Or maybe there's a bug in OSK. Needs further testing (meaning installing a truckload of languages and layouts, and testing them all). Another large coffee, another night at the desk…
robodesign
Posts: 279
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

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

22 Jan 2018, 14:25

Oh, man! wow! you are a guru! I am growing anxious for your edition.

I will keep my names, because they are in English, and it fits with the app. If I remove them, they appear in French here, so I suppose they would appear in the default UI language. If we manage to get the automatic detection of dead keys working properly, then I will remove the whole file :-).

I will send you a screen cap of the registry this evening, a bit later.

Good luck with the work! I am sure it will be awesome.

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

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

22 Jan 2018, 14:48

Oh, ffff…! Damn OSK is giving false information. My script is accurate, at least in regard to Greek Polytonic layout. It turns out - as per here - that the ± key is not a dead key but a normal one.
Ideally I should install as many layouts as possible (unfortunately not all seen here are available in XP) and compare the results of my script with the layouts on the site, because Windows' own OSK is not reliable. Tedious work, I don't think I'll do it.

I'd say the user would want to see layout names as they are displayed originally by the system. But that can be made optional too, a simple flag could direct a function to retrieve Layout Text or Layout Display Name. That way you'd already be prepared for internationalization of the script.
robodesign
Posts: 279
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

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

22 Jan 2018, 14:57

True, let the tedious work for me! Do not bother, just do it. I will thoroughly test it myself.

Please also test my newest version, with mediate nav keys enabled [typing mode settings]. Press backspace. Does it work?

@burque505: Please test the backspace with Mediate nav keys enabled. It is important that I know if this works. Thank you.

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

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

22 Jan 2018, 15:36

Oops, the script crashed three times on me at restart, once after checking for updates, once after canceling a settings window and once after applying settings. First time it ever crashed. I guess you're not doing something right and the system doesn't like that. Didn't look at the code yet.

Backspace seems to work, the little I tested seconds ago.
Last edited by Drugwash on 22 Jan 2018, 15:47, edited 1 time in total.
robodesign
Posts: 279
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

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

22 Jan 2018, 15:46

Can you please investigate the cause of these crashes? I had none in my tests, so far. But I will test it more. The changes I made were not spectacular. And please be more precise about how it crashed.
burque505
Posts: 211
Joined: 22 Jan 2017, 19:37

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

22 Jan 2018, 15:54

Salut baieti, just tested 4.031, everything works fine. Marius, mediate nav keys was checked, backspace works just fine. I just updated from 3.96, if I recall. It didn't crash, although it was a bit slower than usual updating. There could be lots of reasons for that, I'm sure.
In general, all good!
Regards,
burque505
robodesign
Posts: 279
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

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

22 Jan 2018, 15:58

@burque505: thank you very much for your report and great to hear this.
User avatar
Drugwash
Posts: 448
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

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

22 Jan 2018, 16:11

It's not you, it's the darn AHK_H itself. Today I installed 1.1.27.07 and it crashes on all script versions on restart; seconds ago I replaced it with 1.1.27.06 and it doesn't crash anymore. I guess 2018 is not a good year for AHK. or for programmers.
robodesign
Posts: 279
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

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

22 Jan 2018, 16:24

This should be reported in.... Bug reports. It is very bad. I was thinking of upgrading it. Thanks for the update.
User avatar
Drugwash
Posts: 448
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

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

22 Jan 2018, 16:44

Thing is, it only crashes with this script, not with any of the test scripts I have here. And since there's no meaningful crash report it'd be hard to debug.
robodesign
Posts: 279
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

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

22 Jan 2018, 16:49

I will test it on my system as well. If I get the crashes, then I will chop it into pieces to find the culprit,the function or command that crashes it.

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

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

22 Jan 2018, 17:53

It crashes on creating threads after the previous ones were terminated.
I never liked all this separate threads thing.
robodesign
Posts: 279
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

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

22 Jan 2018, 18:50

Oh.... How would you do it then, otherwise?
User avatar
Drugwash
Posts: 448
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

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

22 Jan 2018, 19:07

Dunno, never gave much thought to it. Anyway, I can't find any docs on those threads, the chm in the AHK_H package is a joke, it only mentions the DLL, nothing about the things in the EXE. Where did you find the thread info? Maybe some function was modified or deprecated, such as the ahKTerminate[], which would explain the crash.

BTW, you fail to call keyStrokesThread.ahkTerminate[] in ReloadScript(), although that doesn't change anything in regard to the crash.
robodesign
Posts: 279
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

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

23 Jan 2018, 13:34

Olla 'ombres :-) !

@drugwash: If I add that call, then it crashes on my system :-).

Today's new version is ready:

v4.05 (2018-01-23)
- [new] customize keyboard shortcuts, from Tray menu > Preferences > Global shortcuts. It's not stellar, but it's something at least.
- [new] option to show/hide contextual help at Typing mode window; it was too cluttered
- various bug fixes regarding mediate nav keys

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


Yours truly, Marius. :-)
User avatar
Drugwash
Posts: 448
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

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

23 Jan 2018, 14:09

Before terminating keyStrokesThread you have to call OnMessage(0x4a, "") to stop the message flow. I did that here but still crashes on restart. Tried with alternatives mentioned in the docs, still no go.
I noticed one change in the OnMessage() function in this AHK_H version but it's not that, I disabled both OnMessage() calls in the autoexecute section and still crashes on restart.
No crash on a clean exit though.
And no news from the developer(s).
robodesign
Posts: 279
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

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

23 Jan 2018, 14:16

Weird stuff.... Hope they will respond.
robodesign
Posts: 279
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

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

24 Jan 2018, 13:34

Hello, people!

Today marks a very important release regarding the stability and polishing of this script. There were many bugs and some... were quite *tragic*...


Change log v4.1 (2018-01-24)
- [new] the script will not reload when you go to check different settings windows; it will reload only when settings are changed
- [new] now you can disable each global keyboard shortcut individually
- many bug fixes, important ones
- made changes to the Only Typing mode, to be even more exclusivistic
- made the code prettier thanks to Drugwash

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

Please report any bugs you find.

Best regards, Marius.
rommmcek
Posts: 308
Joined: 15 Aug 2014, 15:18

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

24 Jan 2018, 21:30

Made a quick test after a while. All main features (including diacritics) seem to work fine. Probably for the first time!
It's really useful for some tiny dialogs on high res. monitor!

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Yahoo [Bot] and 15 guests