OnKeyDown TAB value "undocumented"

Report any Hollywood bugs here
Post Reply
User avatar
lazi
Posts: 549
Joined: Thu Feb 24, 2011 11:08 pm

OnKeyDown TAB value "undocumented"

Post by lazi »

Please check this test case!
If you press the TAB key, instead of a "TAB" string in msg.key it returns 8 bytes of $20 (TAB) characters as a string.
Is it at least an undocumented feature :)

(HollyWood 8, OS4)

Code: Select all

Function p_keys(msg)
	Cls
	Locate(0,0)
	NPrint("OnKeyDown key:",msg.key)
	NPrint("Length       :",StrLen(msg.key))
	NPrint("Unpacked:",Unpack(StrToArray(msg.key)))
EndFunction

InstallEventHandler({OnKeyDown=p_keys})

NPrint("Press a key")

Repeat
	WaitEvent
Forever
                 

User avatar
airsoftsoftwair
Posts: 4213
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: OnKeyDown TAB value "undocumented"

Post by airsoftsoftwair »

This is normal behaviour (albeit not documented). If you want to have raw key codes, use the raw key down handlers.

User avatar
lazi
Posts: 549
Joined: Thu Feb 24, 2011 11:08 pm

Re: OnKeyDown TAB value "undocumented"

Post by lazi »

Ahh, ok, but why is the 8 bytes?

User avatar
airsoftsoftwair
Posts: 4213
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: OnKeyDown TAB value "undocumented"

Post by airsoftsoftwair »

lazi wrote:
Sun May 17, 2020 10:58 pm
Ahh, ok, but why is the 8 bytes?
That is my preferred tab width, I always use 8 :)

Post Reply