Page 1 of 1

non alphanumeric scancodes

Posted: Tue Nov 14, 2017 4:37 pm
by Nisaba
The quit window uses an alphanumeric scancode to discern which key has been pressed. By default it responds to the 'Y' key by exiting. is there a way of using scancodes with values that represents - say - the CTRL keypress? in other words, non alphanumeric scancodes?
(CTRL = $5066W)

patches (like this) in question:

Code: Select all

Patch: Keen Vorticons Quit keypress patches
#'Y' key -Keen 1:
%patch $085C  $59

Re: non alphanumeric scancodes

Posted: Tue Nov 14, 2017 9:51 pm
by levellass
It looks like doing so will be a lot more involved than I had first thought, I am not sure it is possible but am still looking at options.

Re: non alphanumeric scancodes

Posted: Tue Nov 14, 2017 10:23 pm
by Nisaba
yeah, I also tried a couple of options before posting here... seems to be too tricky for me.

Re: non alphanumeric scancodes

Posted: Wed Nov 15, 2017 9:38 am
by Nisaba
ok, I found a workaround. not very elegant but manageable. Using the DOSBox mapper could solve the issue. (again, I need this patch for my handheld computer I'm working on.) In theory I have to map the CTRL key plus the Y key to a certain button on my controller.

But I still meet a challenge. I have to make sure, that the Y key (or any alternative alphanumeric scancode) isn't in conflict with other button combinations. for eg. F10 + Y could be a problem.
My new task would be, to find an alphanumeric scancode, which isn't used either by the Vorticons or by the Galaxy engine.
  • list of used / unused alphanumeric scancodes:
    A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ...
  • Code: Select all

    A   $41         J   $4A         S   $53
    B   $42         K   $4B         T   $54
    C   $43         L   $4C         U   $55
    D   $44         M   $4D         V   $56
    E   $45         N   $4E         W   $57
    F   $46         O   $4F         X   $58
    G   $47         P   $50         Y   $59
    H   $48         Q   $51         Z   $5A
    I   $49         R   $52
can you give me your feedback, please? do I overlook something?

Re: non alphanumeric scancodes

Posted: Wed Nov 15, 2017 10:59 pm
by levellass
Keen actually has its own keyboard map, so it's possible to remap keys with patches. For example this patch swaps the x and y keys:

Code: Select all

#Swap x and y keys in Keen 1
%patch $1812D "y"
%patch $18115 "x"

Re: non alphanumeric scancodes

Posted: Wed Nov 15, 2017 11:42 pm
by levellass
Ok, so there are times when the solution to your problems comes to you in a most wonderful manner. Recently Szemi has been asking about how to use the 8x8 font characters. Now these are based on the standard ASCII table, probably to allow for ease of conversion from plain text files to game data. It skips Keen's internal keyboard mapping entirely.

While looking at them my brain flickered and said 'Hey wait a minute, in standard ASCII 'Y' is $59... that means...

So yes, this is far, FAR simpler than I thought! All you need to do is look up a character on the standard ASCII table which I have now added to the wiki at http://www.shikadi.net/keenwiki/Patch:Scancodes

It seems ctrl and alt, as 'control keys' cannot be used in this manner, the game refuses to accept them as valid input in this case. It does however accept enter, esc, tab and backspace and a little remapping would probably be of great value here.

I now have a complete understanding on how things like the savegame windows work (Inputs esc or 1-9) or the Yorp messages (Dismiss with 'enter') So any patches required to change their inputs are easy enough to generate.

Re: non alphanumeric scancodes

Posted: Thu Nov 16, 2017 8:17 am
by Nisaba
what a nice find!
sad enough ctrl/alt aren't featured. so I'm gonna stick with the remapping.