|
Post by Stefan on Apr 20, 2023 16:18:37 GMT -5
I'm probably just being dense here, but I would like to KEYMAP the CTRL-TAB combination to yield the x'09' (horizontal tab) character.
When I bring up the Character Map, click on x'09' and then paste that character into the CTRL-TAB field, it is expanded to a bunch of blanks, which isn't what I want. I could use a different character to be my 'tab' value, e.g. x'A9' (copyright), but the Raster font will then show the "©" symbol and not the "HT" symbol for tab.
All ideas welcome, but I suspect it may not be possible.
|
|
|
Post by Robert on Apr 20, 2023 18:14:06 GMT -5
You can only map the actual Tab or Shift Tab to (PassThru) and then set TABS OFF in your profile to accomplish this. You can't do it with Ctrl Tab, except by possibly defeating the normal use of Tab/Backtab during edit, and I can't imagine you'd want to do that.
It seems the most likely way to accomplish something like this would take a new keyboard primitive syntax for hex characters. Currently there is [[ and ]] notation for entering literal brackets and (nn:[xx]) for literals with a repetition factor.
Perhaps a new syntax something like (X/nn) could be created to enter a hex value as a literal, where "nn" would be any length of hex-digit pairs. I don't see any other way around this.
|
|
|
Post by Robert on Apr 20, 2023 23:33:47 GMT -5
Plan B:
I created a 1 byte named clipboard called RAWTAB.CLIP which had just X'09' then set up a (Paste/RAWTAB) in the Ctrl Tab mapping. it created a bunch of blanks like you got. So, just creating a new keyboard primitive to emit hex characters isn't enough. To use a "paste" approach, there would need to be a new primitive like (PasteRaw/name) to suppress the tab-to-space expansion.
You'd have to approach George on that, if it's important to you.
|
|
|
Post by Stefan on Apr 21, 2023 2:58:54 GMT -5
R, Thanks for your reply. The file profile already specifies TABS OFF.
In any case, the x'09' char is changed to blanks INSIDE the KEYMAP dialog where the file's profile is irrelevant. I only use TAB (Tab) and SHIFT-TAB (Backtab), so the CTRL-TAB combo is freely available. I can map another 'special' char code (eg Copyright) to CTRL-TAB and it works fine.
Your PASTE approach looks interesting. I take it the 'blanks' you saw appeared in the file being edited, suggesting the profile allowed tab expansion (as on initial file load) I'll give that try.
BUt as far as KEYMAP goes, it seems to me the issue is either... - SPFLITE expands the tab code on entry to the KEYMAP dialog rather than accepting the char code ASIS (probable)
- Windows expands the x'09' code on entry to the KEYMAP dialog (less likely - Windows doesn't 'know' how many blanks to use, it would be up to the application - SPFLite).
|
|
|
Post by Robert on Apr 21, 2023 10:47:46 GMT -5
I have a possible answer after several attempts. The idea is to map a key to a keyboard macro that will insert an arbitrary character (I use 'X' for this) then issue a CHANGE command to change the X to an X'09'. It will only work inside the data area of an edit session. You certainly can't use it anywhere else, but on the command line, you already have commands like Change to do that. Obviously, you have to position the cursor exactly where you want the X'09' to be placed beforehand.
No promises, but here is what I mapped to Ctrl Tab that seemed to work:
[X](SaveCursor)(left)(home)[c 'X' X'09'](enter)(RestoreCursor)
I did notice in Hex Mode, I saw the X'09' get inserted, but the character part "collapsed" because SPFLite somehow believes that a Tab takes up no space. That occurred even after I set TABS and XTABS to every combination of ON/OFF and 0/nonzero respectively.
Bottom line: SPFLite just doesn't want a X'09'.
|
|
|
Post by George on Apr 21, 2023 10:53:11 GMT -5
Stefan: Robert: I had thought, when first reading this, that a simple TABS OFF should do it.
But of course it doesn't, because we're still stuck in the old 'lets-look-like-a-3270' mode. And we expect to be able to use TAB to move between screen fields e.g. from line number to the text area; from the command line to the Scroll area etc.
As to entering the data in KEYMAP, all input there is totally Windows controlled, so it expands the TAB into spaces. Based on what, and how to suppress that, I don't know.
It seems the only way is to create a new KB primitive (Hex/hh) to do this.
Of course if this is a one-off need, there's always HEX mode.
George
|
|
|
Post by Stefan on Apr 21, 2023 11:23:37 GMT -5
It's of no great importance, guys. I was looking for a simple way to inject a TAB code into a quoted literal. As the RASTER font has a convenient visible symbol for x'09', I thought I'd use it and enter it via CTRL-TAB key.
I can use another char code instead, one in which neither Windows nor SPFLite has a special interest. I chose x'10' which appears as a "filled-in right arrow head" in RASTER. Mapped to CTRL-TAB it does the job beautifully.
Thank you for your efforts. It was an interesting exercise.
|
|
|
Post by George on Apr 21, 2023 11:30:04 GMT -5
Stefan: Yes, browsing the web, TAB causes problems in all kinds of other apps as well. And Windows 'handling' of it seems to be very poorly documented.
And us old fogeys all well remember setting mechanical tab stops on typewriters, or creating skip fields on drum cards for the old keypunches.
How far TABS has come.
George
|
|
|
Post by Robert on Apr 21, 2023 13:44:37 GMT -5
There is a problem using HEX mode. If you enter a line like this:
abc-/-123 then enter HEX mode and replace the position where / is with X'09', the data reflects the X'09' but the character display now shows
abc--123 and the X'09' shows up where the right-hand - is. Even if TABS OFF is in effect, if you close the file and reopen it, the X'09' disappears and (for me) it is replaced by 4 spaces. No more X'09' anywhere.
Barring some major change or clever strategy, inserting X'09' doesn't seem possible.
|
|
|
Post by George on Apr 21, 2023 15:08:37 GMT -5
Robert: If you don't have a proper font setup, then you get weird results. Here's my disply with Raster 12. Looks fine to me. George
|
|
|
Post by Robert on Apr 21, 2023 15:46:08 GMT -5
My prior problem stemmed from the Consolas font having no glyph for X'09' so its width seems like zero, thus the 'collapse' on the character part. "Raster" fonts do have a glyph, which is why they work.
Here is a formula that seems to work:
1. I used RasterTTF at 18 pitch, other people may like it a little smaller 2. Set XTABS 0 3. Setting of TAB doesn't seem to matter as to ON vs. OFF 4. I have this mapped to Ctrl Tab:
[X](SaveCursor)(left)(home)[c 'X' X'09'](enter)(RestoreCursor) 5. Position to desired position and press Ctrl-Tab
Since most text-based software has an opinion on what Tab means, use of a literal X'09' is asking for trouble. Use it if you insist, but beware, you may likely run into issues.
|
|
|
Post by George on Apr 22, 2023 11:04:03 GMT -5
Robert: Good solution. I just changed to a more oddball character than X (¾).
George
|
|
|
Post by Robert on Apr 22, 2023 11:50:19 GMT -5
The sequence [X](SaveCursor)(left) ensures the dummy "X" is the character that will be found by C "X" X"09" because the "current edit location" points directly at it.
¾ will work fine but any nonblank ANSI will work too. Using "X" was arbitrary. The ¾ could help if there were a bug in the keyboard macro and you wanted it to stick out, which is a valid concern during development.
|
|