I contstruct a simle form called "keyDown", that has both a "setKeyDownResponder" and a "setCharResponder"
Code: Select all
implement keyDown inherits formWindow
open core, vpiDomains
clauses
display(Parent) = Form :-
Form = new(Parent),
Form:show().
clauses
new(Parent) :-
formWindow::new(Parent),
generatedInitialize().
predicates
onKeyDown : window::keyDownResponder.
clauses
onKeyDown(_Source, Key, _ShiftControlAlt) = window::defaultKeyDownHandling :-
stdio::write("\n", Key),
!.
predicates
onChar : window::charResponder.
clauses
onChar(_Source, Char, _ShiftControlAlt) = window::defaultCharHandling :-
stdio::write("\n", Char),
!.
% This code is maintained automatically, do not update it manually.
% 11:49:42-30.4.2019
predicates
generatedInitialize : ().
clauses
generatedInitialize() :-
setText("keyDown"),
setRect(rct(50, 40, 290, 160)),
setState([wsf_ClipSiblings, wsf_ClipChildren]),
menuSet(noMenu),
setCharResponder(onChar),
setKeyDownResponder(onKeyDown).
% end of automatic code
end implement keyDown
The onChar predicate does behave as expected and write the Char to the message window.
What am I missing?
thanks in advance
Dave