[Script] KeypressOSD - Display key press on screen

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
rommmcek
Posts: 1470
Joined: 15 Aug 2014, 15:18

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

Post by rommmcek » 30 Apr 2018, 00:40

I'm using just basic features and no bugs appeared so far.
- you might set a list of testing points

I was in the hurry and forgot to give instructions.
- install the font iCaret.ttf
- replace , Lola := "│" with , Lola := "'"
- run keypress-OSD.ahk
- choose Typeface font in "OSD appearance" menu
- type something - don't use apostrophe ( ' ) - and move the caret back and forth
Attachments
Caret With Zero Width.gif
Caret With Zero Width.gif (83.35 KiB) Viewed 6890 times

robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

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

Post by robodesign » 30 Apr 2018, 02:52

Hey!

Thanks a lot for the instructions.

It is very interesting, I like the idea, but this applies only when using this font, you created... It would great if the caret would use its own font - within a RichEdit control. Do you have any experience with such controls?

As a side note, ... it is not a good idea to use an apostrophe or any other character commonly used in writing, because KeyPress OSD gets lost and no longer knows which one is the actual caret and which one is the typed character.

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

Post by robodesign » 30 Apr 2018, 17:28

At rommmcek.

I just had an idea now....

I could have a font just for the possible caret shapes. It wouldn't include any other character.

And.... At preferences, the user would actually select the substitute font for the missing characters in the main font. Would this be possible? To define the substitute font in some way....

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
rommmcek
Posts: 1470
Joined: 15 Aug 2014, 15:18

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

Post by rommmcek » 01 May 2018, 00:03

And.... At preferences, the user would actually select the substitute font for the missing characters in the main font. Would this be possible? To define the substitute font in some way....
For Edit Control, I think not, but for Rtf sure you can.
Rtf is demanding, but I made simple example to show, in your case it's not over complicated. Search for "rtf control words" too.
For include file and complex example look here.
Attachments
Rtf Control and iCaret with zero space.zip
(2.04 KiB) Downloaded 186 times

User avatar
rommmcek
Posts: 1470
Joined: 15 Aug 2014, 15:18

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

Post by rommmcek » 01 May 2018, 09:15

This is way simpler as before and looks pretty promising...

Code: Select all

rtf1= 
(
{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\f Typeface;}{\f1\fswiss Helvetica;}}
{\colortbl ;\red255\green255\blue0;}
\pard\highlight1\f1\b
\fs64 This is plain te\f0 '\f1 xt with zero width cha\f0 '\f1 racters.\par second line\par
}
)
rtf2= 
(
{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\f Typeface;}{\f1\fswiss Helvetica;}}
{\colortbl ;\red255\green255\blue0;}
\pard\highlight1\f1\b
\fs64 This is plain te\f0 ,\f1 xt with zero width char\f0 '\f1 acters.\par second line\par
}
)

robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

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

Post by robodesign » 01 May 2018, 09:45

Hello!

I looked into this, Class RichEdit and... all I can say, it is beyond my level of skills. However, you can try to implement this into KeyPress OSD. Download latest version, ... and modify it. If you achieve something good, post it here and I will merge it into the main version, if it passes all my tests.

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
rommmcek
Posts: 1470
Joined: 15 Aug 2014, 15:18

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

Post by rommmcek » 01 May 2018, 23:51

This is disappointing.
O.k. Rtf is a new field (for me too), but just don't get it, you gave up before your started.
Made a quick demo adaptation of Type Enlarger uploaded on page 20 of this thread.
- run the script
- type some text
- navigate left and right (do not go beyond text displayed in OSD)
- does not support editing inside the text string, but you can hit End at any time
- does not support special characters (they had to be replaced with appropriate Rtf control words just the way the caret is), but supports dead characters

- Esc, Up and Down: clear OSD
- #Esc: Exit
- ^c: copy marked text and display it in the OSD
- ^Ins: copy the word or part of it left form caret
- Left: navigate left
- Right: navigate right
- End: go to the end of the string (Home not supported)

Edit: Just figured it out, my "magic" line could be still more condensed:

Code: Select all

Gui, 2:Show, % (!sr?"":"x" KbdX " y" KbdY sr:="") " w" KbdW " h" KbdH, Virtual keyboard ; for UR6
Gui, 3:Show, % !sl?"":"x" 380 " y" 360 sl:="", Preview layout: %Layout% ; for 1.30
Attachments
Rtf Enlarger.zip
(20.08 KiB) Downloaded 169 times

robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

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

Post by robodesign » 03 May 2018, 04:32

Hello!

Thank you for the demo. It is interesting. However, I am not sure this issue [the caret width] is 'that' important. I personally believe that the efforts one needs to put into fixing the caret width issue are too big compared to the benefits it yields. And, once I would make this change, unforseen things will occur, that is, various bugs / regressions.

Just to give you a hint, while testing your script, for no reason, it switches the keyboard layout . I do not know why this happens. It happens only sometimes. This weird behavior occurs even when no other script is running.

However, as I previously said... feel free to make the modifications to my code, and if you get something working, I will do various tests and even try to help with bug fixes... such that we can merge the changes to the main branch. But, please keep in mind, this will happen only when I find there is no regression compared to the current 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

Post by robodesign » 04 May 2018, 15:51

Hello! Quick update...

Edit.

v4.31.8 (2018-05-12)
- [important bug fix] fixed a bug that caused crashes on some systems when Mouse Ripples were activated

v4.31.7 (2018-05-09)
- removed option to ignore specific keys; it was limited only to typing keys; therefore, users were not able to ignore keys such as Esc or F1; this feature created confusion
- fixed a glitch; xbutton 1 and 2 were not considered as mouse buttons; they were displayied in the OSD even if "Show mouse buttons" was deactivated.
.................

(2018-05-04)
Today I released version 4.31.6 of KeyPress OSD. It features many fixes, and important ones. There was a regression that caused issues with the global shortcuts, which rendered them unusable.

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

Post by robodesign » 15 May 2018, 16:20

Holla, people!
Another quick update.

v4.32 (2018-05-15)
- fixed issues related to Caret Halo, Mouse Visual Clicks [the blocks and ripples]... Now, right-clicks should work in MS Word.... Previously, these features, when activated, were interfering and it was impossible to invoke the context menu in MS Word by right-clicking.
- and other fixes.

All files were updated. Binaries. Github.

Recently, I've been only doing bug hunting and fixes.

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

Post by robodesign » 04 Jun 2018, 05:55

Hey, guys!

v4.32.2 (2018-06-01)
- bug fixes regarding mouse ripples; they should not be clickable anymore
- other minor fixes

v4.32.1 (2018-05-23)
- bug fixes regarding Emojis and the auto-replace feature
- now it should no longer stall if the host application stalls

All files updated:

On GitHub: https://github.com/marius-sucan/KeyPress-OSD

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

ZIP Package compiled [x64 / x32], includes AHK_H and sources:
http://marius.sucan.ro/media/files/blog ... mpiled.zip

Please let me know if you have any issues with it. Suggestions are welcomed.

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.

takayo97
Posts: 63
Joined: 09 Jun 2018, 16:30

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

Post by takayo97 » 02 Jan 2019, 11:30

i tried robodesign's edition.
When I ran keypress-osd.ahk, I got an error. call to nonexistent function
It was pointed at line 10714: ahkThread_Free(deleteME)

User avatar
Drugwash
Posts: 850
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

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

Post by Drugwash » 02 Jan 2019, 17:22

This script is meant to be run under AHK_H, not AHK_L (or any other version).
Please deploy AHK_H somewhere on your system and launch this script through that executable.
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

Post by robodesign » 02 Jan 2019, 18:47

takayo97 wrote:
02 Jan 2019, 11:30
i tried robodesign's edition.
When I ran keypress-osd.ahk, I got an error. call to nonexistent function
It was pointed at line 10714: ahkThread_Free(deleteME)
Delete that line and it will work with AHK-L. But in a limited mode. All the features relying on external modules won't work. However, the core, should work just fine.

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
SirSocks
Posts: 360
Joined: 26 Oct 2018, 08:14

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

Post by SirSocks » 14 May 2020, 09:26

This is perfect! Thank you!

robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

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

Post by robodesign » 14 May 2020, 13:27

SirSocks wrote:
14 May 2020, 09:26
This is perfect! Thank you!
Glad you like it, please also check the commercial edition, which is heaps better ;-).
https://keypressosd.com/

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

Post by robodesign » 27 May 2020, 04:40

Hello, guys!

It seems KeyPress OSD is very much loved [judging by how many stars I get on GitHub for it]. Therefore, I decided to release a new freeware / open source version. This release includes two previous releases from 2018.

Change log:
v4.35 (2018-07-12) - freeware release
- [new] quick auto-replace entries manager; a new way to easily add/remove entries accessible by Ctrl+Shift+\
- [new] horizontal bar to visually indicate how much of the text in the OSD is visible, useful when the text is longer than the maximum width of the OSD
- [new] option to show the language code in the OSD [at keyboard preferences]
- [new] the ability to individually delete stored clipboards, at keyboard preferences
- [improvement] the shortcuts panel is now split into tabs such that it is easier to use
- more bug fixes

v4.34 (2018-07-04)
- [new] option to automatically shrink text to fit the OSD width; the user has the option to set the minimum font size as well
- [new] one can also change the scaling factor for the height of the OSD
- various UI improvements and fixes in the backend and at the preferences windows
- new KeyPress OSD icon

On GitHub:
https://github.com/marius-sucan/KeyPress-OSD

ZIP Package compiled [x64 / x32], includes source files:
http://marius.sucan.ro/media/files/blog/ahk-scripts/keypress-osd-compiled.zip

All files updated. Github and compiled editions. In theory, one should be able to use the built-in updater in v4.33 [the previous free version], to update to the new one. If it somehow fails, please download the ZIP.

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.

c7aesa7r
Posts: 209
Joined: 02 Jun 2016, 21:09

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

Post by c7aesa7r » 08 Nov 2020, 00:31

@tmplinshi for example, to me type a @ i must press shift+2, is possible to display a @ instead of shift+2 on the osd gui?

Also when I press shift + ` it generates:

Code: Select all

´`
, could be a bug? i have download from github KeypressOSD v2.52

robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

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

Post by robodesign » 08 Nov 2020, 07:08

c7aesa7r wrote:
08 Nov 2020, 00:31
@tmplinshi for example, to me type a @ i must press shift+2, is possible to display a @ instead of shift+2 on the osd gui?

Also when I press shift + ` it generates:

Code: Select all

´`
, could be a bug? i have download from github KeypressOSD v2.52
You can use the freeware edition of KeyPress OSD developed by me. It can do what you asked for. You can disable typing mode if you intend to use it for screencasts or video tutorials.

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.

ccacemax
Posts: 1
Joined: 27 Mar 2021, 22:13

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

Post by ccacemax » 18 Jan 2022, 23:22

WOOOOOW :clap:

Post Reply

Return to “Scripts and Functions (v1)”