diff --git a/pkgs/gui-pkgs/gui-doc/scribblings/gui/keymap-class.scrbl b/pkgs/gui-pkgs/gui-doc/scribblings/gui/keymap-class.scrbl index 2a9b05c2..1dc1da23 100644 --- a/pkgs/gui-pkgs/gui-doc/scribblings/gui/keymap-class.scrbl +++ b/pkgs/gui-pkgs/gui-doc/scribblings/gui/keymap-class.scrbl @@ -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?]{ diff --git a/pkgs/gui-pkgs/gui-lib/mred/private/wxme/keymap.rkt b/pkgs/gui-pkgs/gui-lib/mred/private/wxme/keymap.rkt index cb68fb16..9229bcd2 100644 --- a/pkgs/gui-pkgs/gui-lib/mred/private/wxme/keymap.rkt +++ b/pkgs/gui-pkgs/gui-lib/mred/private/wxme/keymap.rkt @@ -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)