#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@"  KeyCoder4dr KeyCoder UVerdana ULucida Grande cREVGeneralscriptChecksumُ B~ bookmarks handlerList tempScript prevHandlerscriptSelection char 1 to 0script

 PAon rawKeyDown pRaw put pRaw into fld "Raw" put empty into fld "ASCII" put empty into fld "Type" put checkModifiers() into fld "Mods" pass rawKeyDown end rawKeyDown on keyDown pKey put charToNum(pKey) into fld "ASCII" if pKey = space then put "space" into fld "Type" else put pKey into fld "Type" pass keyDown end keyDown function checkModifiers put "" into tMods if the shiftKey is down then put "shift, " after tMods if the controlKey is down then put "ctrl, " after tMods if the optionKey is down then put "opt/alt, " after tMods if the commandKey is down then put "command, " after tMods delete char -2 to -1 of tMods return tMods end checkModifiers -- special key handlers on arrowKey pDir put "arrow " & pDir into fld "Type" pass arrowKey end arrowKey on backspaceKey put "backspace" into fld "Type" pass backSpaceKey end backspaceKey on deleteKey put "delete" into fld "Type" pass deleteKey end deleteKey on enterKey put "enter" into fld "Type" pass enterKey end enterKey on escapeKey put "escape" into fld "Type" pass escapeKey end escapeKey on functionKey pKey put "F" & pKey into fld "Type" pass functionKey end functionKey on returnKey put "return" into fld "Type" pass returnKey end returnKey on tabKey put "tab" into fld "Type" pass tabKey end tabKey  cREVGeneralscriptChecksumyc!n]_mY9F bookmarks handlerListqrawKeyDown keyDown checkModifiers arrowKey backspaceKey deleteKey enterKey escapeKey functionKey returnKey tabKey tempScript prevHandler rawKeyDownscriptSelectionchar 316 to 315script

on rawKeyDown pRaw

put pRaw into fld "Raw"

put empty into fld "ASCII"

put empty into fld "Type"

put checkModifiers() into fld "Mods"

pass rawKeyDown

end rawKeyDown

on keyDown pKey

put charToNum(pKey) into fld "ASCII"

if pKey = space then put "space" into fld "Type"

else put pKey into fld "Type"

pass keyDown

end keyDown

function checkModifiers

put "" into tMods

if the shiftKey is down then put "shift, " after tMods

if the controlKey is down then put "ctrl, " after tMods

if the optionKey is down then put "opt/alt, " after tMods

if the commandKey is down then put "command, " after tMods

delete char -2 to -1 of tMods

return tMods

end checkModifiers

-- special key handlers

on arrowKey pDir

put "arrow " & pDir into fld "Type"

pass arrowKey

end arrowKey

on backspaceKey

put "backspace" into fld "Type"

pass backSpaceKey

end backspaceKey

on deleteKey

put "delete" into fld "Type"

pass deleteKey

end deleteKey

on enterKey

put "enter" into fld "Type"

pass enterKey

end enterKey

on escapeKey

put "escape" into fld "Type"

pass escapeKey

end escapeKey

on functionKey pKey

put "F" & pKey into fld "Type"

pass functionKey

end functionKey

on returnKey

put "return" into fld "Type"

pass returnKey

end returnKey

on tabKey

put "tab" into fld "Type"

pass tabKey

end tabKey

 info 4 cREVGeneral revUniqueID 1055553200144 Press any key, with or without modifiers, and this stack will tell you the rawKey code, the ASCII number and the actual keys pressed. label Dx cREVGeneral revUniqueID 1055553301988 raw key code: label bx cREVGeneral revUniqueID 1055553338048 ASCII code: label x cREVGeneral revUniqueID 1055553341505 key as typed: label x cREVGeneral revUniqueID 1055553344188 modifiers: Raw `zF cREVGeneral revUniqueID 1055553409634 83 ASCII `zd cREVGeneral revUniqueID 1055553419794 83 Type `z cREVGeneral revUniqueID 1055553424984 S Mods `z" cREVGeneral revUniqueID 1055553428752 shift