diff options
author | Adam Chlipala <adam@chlipala.net> | 2012-07-21 10:02:53 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2012-07-21 10:02:53 -0400 |
commit | 3e838a5bf95222adb9add226aa3732c3c28633bc (patch) | |
tree | b3a11523df44e927ac749c5c6aa752744cb83b5d /src | |
parent | db71493ffd90e2668259efbb549f7a781c2530db (diff) |
New event records for key and mouse handlers
Diffstat (limited to 'src')
-rw-r--r-- | src/monoize.sml | 10 | ||||
-rw-r--r-- | src/settings.sml | 9 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/monoize.sml b/src/monoize.sml index 4985c932..86d8389f 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -3311,8 +3311,14 @@ fun monoExp (env, st, fm) (all as (e, loc)) = val e = case #1 dom of L'.TRecord [] => (L'.EApp (e, (L'.ERecord [], loc)), loc) - | _ => (L'.EApp ((L'.EApp (e, (L'.EFfiApp ("Basis", "kc", []), loc)), - loc), (L'.ERecord [], loc)), loc) + | _ => + if String.isPrefix "Onkey" x then + (L'.EApp ((L'.EApp (e, (L'.EFfiApp ("Basis", "keyEvent", []), loc)), + loc), (L'.ERecord [], loc)), loc) + else + (L'.EApp ((L'.EApp (e, (L'.EFfiApp ("Basis", "mouseEvent", []), loc)), + loc), (L'.ERecord [], loc)), loc) + val s' = " " ^ lowercaseFirst x ^ "='uw_event=event;exec(" in ((L'.EStrcat (s, diff --git a/src/settings.sml b/src/settings.sml index 28739d6a..66bc7238 100644 --- a/src/settings.sml +++ b/src/settings.sml @@ -160,7 +160,8 @@ val benignBase = basis ["get_cookie", "onConnectFail", "onDisconnect", "onServerError", - "kc", + "mouseEvent", + "keyEvent", "debug", "rand", "now", @@ -194,7 +195,8 @@ val clientBase = basis ["get_client_source", "onConnectFail", "onDisconnect", "onServerError", - "kc", + "mouseEvent", + "keyEvent", "onClick", "onDblclick", "onKeydown", @@ -267,7 +269,8 @@ val jsFuncsBase = basisM [("alert", "alert"), ("substring", "ssub"), ("strcspn", "sspn"), ("strlenGe", "strlenGe"), - ("kc", "kc"), + ("mouseEvent", "uw_mouseEvent"), + ("keyEvent", "uw_keyEvent"), ("minTime", "0"), ("islower", "isLower"), |