Paste for HP21S under Emu42

All other HP calculators

Paste for HP21S under Emu42

Postby mike-stgt » Fri Apr 12, 2024 7:30 am

It's complicated. Emu42 offers for several models the feature to paste numbers from the clipboard to a calculator. But not for the HP21S. To overcome this lack I use a AHK script to paste per automated typing.

It's complex. Emu42 knows nothing about keys, only scan-codes. A KML file defines buttons with scan-codes and their location on the faceplate. This makes it operable with a mouse. To control the virtual calculator with the PC keyboard, the KML file must "marry" the buttons with PC key codes -- which are used by the AHK script to type numbers. To enable the entry of negative numbers and those with exponent, "p" must be linked in the KML file with E (or EXP if you prefer) and "q" with CHS.

The attached ZIP contains a bundle of KML and KMI files and the corresponding faceplate image. The AHK script makes Ctrl+v work almost as expected. "Almost" as it offers some fuzzy logic, "6,28318 -53.0718e-5" will paste the first number only, while blank or any of "',." (w/o double quotes) may serve as digit grouping. Thus "-28 318 530,718e-321" will yield -2,8318530718E-314. If comma or dot is used as decimal separator does not matter (mostly) and is independent from the calculator setting. Pasting "28.318.530,718" or "28,318,530.718" is irrelevant.

Assumedly you do have Emu42 already installed and run an HP21S with it. Maybe you also have AHK already installed for other reasons. Then you just have to unzip the bundle, best to the directory of your other KML files. Running the AHK script will look for a 21S under Emu42 and bring it to the front. If none is found, it will be started -- but for this to work you have to adjust the file ID (drive, path, name, type must be "e21") of the 21S state file you use typically, see line 17 starting with "Run(...". The AHK script quits self-acting when the 21S session ends.

Have fun.
Attachments
Emu21S.zip
KML for 21S with faceplate as GIF and AHK script for Ctrl+v
(74.17 KiB) Downloaded 438 times
mike-stgt
.........
.........
 
Posts: 182
Joined: Tue Dec 24, 2019 12:12 pm

Return to Other HP Calculators

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest

cron