TIP: Click on subject to list as thread! ANSI
echo: semware
to: All
from: `Jan A. Nauta`
date: 2003-02-14 23:17:10
subject: [TSEPro] Re: Replacement for: binary [`getshift.bin`]? (Re: Message

From: "Jan A. Nauta" 
@Date: Fri, 14 Feb 2003 13:47:10 +0100
@Sender: semware-owner{at}sawasdi.apana.org.au



20030314

Thanks Sammy for the code below. It works like a charm. The trade-off
is that you have to check all your keybindings this way.
For the moment I am happy with it because I can use it in a project
that, dependent on the mode it is working in, catches all the hotkeys
defined in it anyway (I mean: in there every keybinding is checked already).

By the way, I found the way to default the compiler to produce
a mapfile when compiling a .s file. Evidently you have seen the need
for this facility beforehand:

|Compile from List||Command = 
'&SCPath&sc32 -m &fn& >
&output&'

I also came across the Semware Help Compiler (for the .txt extension) in
this
list. According to the Command ( = 'q &fn& -ecompress -equit') it is q.exe.
Am I correct in thinking that with the Help Compiler you can make Helpfiles
like the ones in TSE4?

Jan

> -----Original Message-----
> From: tsepro-bounce{at}freelists.org [mailto:tsepro-bounce{at}freelists.org]On
> Behalf Of Sammy Mitchell
> Sent: donderdag 13 februari 2003 02:10 uur
> To: tsepro{at}freelists.org
> Subject: [TSEPro] Re: Replacement for: binary ["getshift.bin"]? (Re:
> Message submitted to 'tsepro')
> Importance: High
>
>
>
> Jan A. Nauta wrote:
> >But the crux of the problem still exists: to discriminate
> >between shifted (hot)keybindings and not-shifted
> >(hot)keybindings. I have made three examples to state my
> >case: example1 is my current TSE1.00 configuration,
> >examples 2 and 3 are experiments to translate that
> >configuration to the new TSE4.00 software.
>
> Note that this change was implemented in TSE v2, way back in
> 1994.  So, it has been the this way for a long time, not
> just with v4.
>
> There may be another way, but this is all I could come up
> with:
>
> In your WhenLoaded, do the following:
>
>     Hook(_AFTER_GETKEY_, afterGetKey)
>
> Somewhere before the WhenLoaded, include the following
> procedure:
>
> proc afterGetKey()
>     integer the_key = Query(Key)
>     if HiByte(the_key) & _KEY_SHIFT_
>         Set(Key,
>             ((HiByte(the_key) & ~ _KEY_SHIFT_) shl 8)
>             | LoByte(the_key))
>     endif
> end
>
> Now, use the following for ShiftKeyPressed()
>
> integer proc ShiftKeyPressed()
>     return (GetKeyFlags() & _SHIFT_KEY_)
> end
>
> !!!_note_!!!! _KEY_SHIFT_ and _SHIFT_KEY_ are two different
> values. Use _SHIFT_KEY_ with GetKeyFlags(), and _KEY_SHIFT_
> with Query(key).  I need a review board to keep bad things
> like this from happening!
>
>
> Here is a simple macro to test this, to make sure it is
> working for you.  Press for instance, f8, then shift-f8.
> Note that it doesn't change normal ASCII keys such as 'a'
> and 'A'.
>
> -----cut here-----------------------------------------------
> proc afterGetKey()
>     integer the_key = Query(Key)
>     if HiByte(the_key) & _KEY_SHIFT_
>         Set(Key,
>             ((HiByte(the_key) & ~ _KEY_SHIFT_) shl 8)
>             | LoByte(the_key))
>     endif
> end
>
> proc main()
>     integer key, flags
>
>     Hook(_AFTER_GETKEY_, afterGetKey)
>     Set(Attr, Color(Bright Yellow on Blue))
>     PopWinOpen(1, 1, 80, 25, 1, "", Color(Yellow on Blue))
>     ClrScr()
>     GotoXY(1, 1)
>     repeat
>         key = GetKey()
>         flags = GetKeyFlags()
>         WriteLine(key:4:'0':16;
>             flags:4:'0':16;
>             KeyName(key);
>             iif(flags & _SHIFT_KEY_, "(shift pressed)",
""))
>     until key == 
>     PopWinClose()
>     Unhook(afterGetKey)
> end
> -----cut here-----------------------------------------------
>
> Anyway, this should give you the v1.0 key mapping behavior,
> hopefully.
>
> >TSE but to the OS - Win2K for example. So I have to use the
> >Windows version of TSE). Therefore it would be useful to
> >know how I can set the map switch of the SAL compiler to
> >default to TRUE when compiling an .s file.
>
> There isn't a way.  You just have to use the -m switch when
> you want a map file.
>
> --
> Sammy Mitchell
>
>
> --
> TSEPro mailing list
>
>


--
TSEPro mailing list



---
[sawasdi.apana.org.au] (3:800/846.13)
* Origin: apana>>>>>fidonet
SEEN-BY: 633/267 270
@PATH: 800/846 1 640/954 774/605 123/500 106/1 379/1 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.