News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Changing F-keys behavior

Started by pimparp, June 19, 2012, 02:14:07 AM

Previous topic - Next topic

pimparp

Hi, bear with me as I'm back programming after being out of it for 20 years. I used a resident .COM to intercept kbd interrupt and put a string  in F12 for example and get my own output like having my email address out instead of typing it.  I have a SCANCODE. ASM written for DOS that I was (am) trying to adapt but obviously I'm off my league now. I'm retired now and would like to get back to writting new codes.
Pierre

dedndave

hi Pierre - welcome to the forum

ANSI.SYS can reassign keys like that for you by using ANSI escape sequences
although - that is all old DOS stuff, which does not really work on modern OS's

you can assign hotkeys through the control panel

pimparp

Thank you dedndave, I appreciate your answer although I have more in mind.

jj2007

Welcome to the Forum, Pierre :icon14:

I guess I know what you want. Many years ago I used to have a resident proggie that accepted exactly two keys after hitting F2, and expanded e.g. <F12> ic to <a bunch of lines that correspond to your idea of insert code>

On Windows, implementing that is not trivial, because every process has its own environment, keyboard buffer included. There are workarounds, but they are probably illegal, in some sense ;)

It becomes a lot simpler if you can do it from within your own process. If you've written the editor that uses this feature, just insert the necessary and off it goes. For example, RichMasm (MasmBasic's editor) uses the space key to expand e.g. .rep to...
   .Repeat
      x
   .Until 0

... and even selects the x so that you can just continue typing the details of your loop. Masm32's QEditor has a similar feature afaik.

The problem is that doing the same for an editor that you have not written yourself would require an intrusion into its process space. That is commonly called hacking, and not polically correct in this Forum, for good reasons...