add is-function-added? is keymap%

original commit: fbb16de87131d6a1705288de55c529baa32b8eaa
This commit is contained in:
Robby Findler 2013-11-28 20:03:38 -06:00
parent cb0e0e7fd1
commit 156b23762f
2 changed files with 12 additions and 2 deletions

View File

@ -50,6 +50,14 @@ When the function is called, it gets the arguments that were passed to
}
@defmethod[(is-function-added? [fname string?]) boolean?]{
Returns @racket[#t] if @racket[fname] has been added
via @method[add-function keymap%] to this keymap
and @racket[#f] otherwise.
This method doesn't check chained keymaps to see if the function
has been added to one of those.
}
@defmethod[(break-sequence)
void?]{
@ -339,8 +347,7 @@ A function name does not have to be mapped to a handler before input
function names.
}
@defmethod[(remove-chained-keymap [keymap (is-a?/c keymap%)])
void?]{

View File

@ -720,6 +720,9 @@
chain-to)]
[else
(error 'keymap "no function ~e" name)])))
(def/public (is-function-added? [string? name])
(and (hash-ref functions name #f) #t))
(def/public (get-double-click-interval)
double-interval)