Highlighted
Trusted Contributor.
Trusted Contributor.
2758 views

Reassigning Ctrl-Del Windows Keystroke

I have a user request to reassign the Windows CTRL-Del (Erase to end of line = kL) keystroke to an Fkey (editing only - no termination no exception or exception value.).

Using AcuGT runtime for Windows I have had some limited success with text mode (not ENTRY-FIELD) with 

KEYSTROKE Edit=Erase-Field k9 

With it, F9 erases the entire text field but has no effect in ENTRY-FIELDS.

Ideally I would like

KEYSTROKE Edit=Erase-to-End k9

to mimic CTRL-Del for both text fields and ENTRY-FIELDs, but I can't make it work for either.  (No effect for ENTRY-FIELD and works like Erase-Field for text.)

The user would be happy with Erase-Field.

Thanks for any suggestions.

Sal

UBCC Development

Sal Cambareri

UBCC

Director Software Development

Tags (1)
0 Likes
12 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Reassigning Ctrl-Del Windows Keystroke

I used a graphical screen and execute it with crun32 (intead of wrun32) and the KEYSTROKE edit=erase-to-end k9
works
From our docs:
Many editing keys are available to modify the text. These editing keys are defined by the host graphical system, and cannot be defined by your KEYSTROKE configuration entries. For example, under Windows, when the cursor is in an entry field, the left-arrow key moves the cursor to the left in the field. If the left-arrow key is redefined in the KEYSTROKE file to perform another function, that function is ignored while the cursor is in the entry field.

Base on that, you would need to have an exception value defined or k9 and then when that exception ccurs find where the cursor is in the field and delete all characters after the cursor.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Reassigning Ctrl-Del Windows Keystroke

[deleted]
0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

RE: Reassigning Ctrl-Del Windows Keystroke

Thanks for you reply. I appreciate knowing that reassignment of the Windows CTRL-DEL is not possible for ENTRY-FIELDs. That will alone will save me much frustration.
Just to confirm that I understand what you are saying:
1. For most of our users who run wrun32, the KESTROKES edit features are overridden by Windows; we cannot change that as we could under Unix or in Text mode. We have almost no crun32 (Unix?) users so that solution is not available to us.
2. In order to use the exception key/cursor position solution we would need to code for every Entry-field a separate exception routine to edit the specific data field value when F9 is pressed. If that is what you are saying that solution is not practical for us since we have many thousands of entry fields in our programs and each would would have to separately amended.

Sal Cambareri

UBCC

Director Software Development

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

RE: Reassigning Ctrl-Del Windows Keystroke

[deleted]

Sal Cambareri

UBCC

Director Software Development

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Reassigning Ctrl-Del Windows Keystroke

You can go generic too. The exception logic can point at CHECK-KEY-STATUS paragraph and then based upon the control number and the control type you can react to it. The trick is to put all that logic at the top of the CHECK-KEY-STATUS paragraph so it gets to it first. You can have multiple copybooks with CHECK-KEY-STATUS paragraph in it and then use the specific copybook you need for the screen type. That's how we did it in New Port Richey. Of course, you have to track the control number and the control type.
0 Likes
Highlighted
Visitor.

RE: Reassigning Ctrl-Del Windows Keystroke

Pretty sure that tekbaba link was a scam; when I clicked it the other day it sent me to a download page for some fix-my-pc virus checker or something similar. Now it's under construction... I clicked Report Abuse on the post.
Highlighted
Absent Member.
Absent Member.

RE: Reassigning Ctrl-Del Windows Keystroke

The underlying architecture here is that controls are responsible for their own user interface. It "works" in crun32.exe because you would be using our own implementation of the entry-field control. With the Windows entry-field, the implementer is Microsoft and you get their UI. Obviously the runtime does some overriding, but, it largely tries to stay out of the way.

One way you can probably get the effect you want is to look for some 3rd party tool that intercepts the keyboard at a lower level and play games there. Although I haven't tried it, I suspect an "autohotkey" macro could translate a particular function key press into the ctrl-del sequence universally for the runtime.
0 Likes
Highlighted
Visitor.

RE: Reassigning Ctrl-Del Windows Keystroke

Drake, that's a great idea about using AutoHotKey, so I just gave it a try (I already have AHK installed and use it for a number of things). And yes, it works great! Here's what I put in my AHK script to make this work:

#IfWinActive ahk_exe wrun32.exe
    F9:: send ^{Del}
return

Of course, this solution involves installing AutoHotKey and running the script on all the end-users' PCs. But AHK also has an option to convert a script into a stand-alone, "portable" executable which may be a little easier to distribute and invoke. So you'd just need to install the full AHK package on a development machine, where you'd code and test the script, then compile to a portable .exe and distribute it to the users. You might be able to use WMI or Group Policy to install and run it at startup on each PC.

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

RE: Reassigning Ctrl-Del Windows Keystroke

Thanks. I will definitely look into crun32.exe. Until today I had no idea it existed and when Steven mentioned it I had assumed it was a Unix runtime. If it supports the windows features that we use, that should work for us.

Sal Cambareri

UBCC

Director Software Development

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

RE: Reassigning Ctrl-Del Windows Keystroke

Thanks. If crun32.exe doesn't work for us, I definitely look into this. If we did not allow our users' operators to freely assign the meanings of all their function keys it would be a good fit. (I used F9 in my example to keep it simple.) We would need to allow it to work for all 30 function keys per each operator's custom selection.

Sal Cambareri

UBCC

Director Software Development

0 Likes
Highlighted
Visitor.

RE: Reassigning Ctrl-Del Windows Keystroke

Hi Sal,

crun32.exe is the so-called "console-mode runtime" for Windows. It uses a character-based UI in a "dos" console window. So it's NOT graphical and doesn't support all of the Windows GUI controls that you might be using. For the controls it does support, they're converted to character-based equivalents (using line-drawing characters, etc.). So the UI will look a lot like the Unix runtime's (which displays in a terminal emulator).
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.