diff options
author | Enrico Tassi <Enrico.Tassi@inria.fr> | 2014-04-09 10:14:11 +0200 |
---|---|---|
committer | Enrico Tassi <Enrico.Tassi@inria.fr> | 2014-04-09 10:33:11 +0200 |
commit | fda8ba0154742f9cbab2b88eed88d52c1f01129c (patch) | |
tree | a5d6bc613c4e499b5fb1e4979b3b5faf3bc4773a /ide/nanoPG.ml | |
parent | 43fbb57e7982c028ee0c74b0252f24fef29a68a4 (diff) |
nanoPG: takeover keypress only when text view has focus
Diffstat (limited to 'ide/nanoPG.ml')
-rw-r--r-- | ide/nanoPG.ml | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ide/nanoPG.ml b/ide/nanoPG.ml index 9c4f40f7d..d4b32b9ce 100644 --- a/ide/nanoPG.ml +++ b/ide/nanoPG.ml @@ -294,6 +294,10 @@ let init w nb ags = let status = ref empty in let reset () = eprintf "reset\n%!"; cur := pg in ignore(w#event#connect#key_press ~callback:(fun t -> + if nb#current_term.script#misc#get_property "has-focus" <> + `BOOL true + then false + else begin eprintf "got key %s\n%!" (pr_key t); if current.nanoPG then begin match find gui !cur t with @@ -305,7 +309,7 @@ let init w nb ags = cur := c; true | `NotFound -> reset (); false end else false - )); + end)); ignore(w#event#connect#button_press ~callback:(fun t -> reset (); false)) |