@@ -237,9 +237,9 @@ class CommandControl : Widget
237237 commandField.h = 32 ;
238238 commandField.bufferView.onChanged.connect(&handleBufferChanged);
239239 commandField.name = " commandEntryField" ;
240- commandField.onCommandCallback = (Event event, Widget w) => onCommand (event);
241- commandField.onKeyDownCallback = (Event event, Widget w) => onKeyDown (event);
242- commandField.onKeyUpCallback = (Event event, Widget w) => onKeyUp (event);
240+ commandField.onCommandCallback = (CommandEvent event, Widget w) => onCommandEvent (event);
241+ commandField.onKeyPressedCallback = (KeyPressedEvent event, Widget w) => onKeyPressedEvent (event);
242+ commandField.onKeyReleasedCallback = (KeyReleasedEvent event, Widget w) => onKeyReleasedEvent (event);
243243
244244 auto ww = new Widget(this , 0 , 0 , 1 , 1 ); // dummy for grid cell
245245 ww.name = " dummy" ;
@@ -277,16 +277,16 @@ class CommandControl : Widget
277277 questionLabel.text = " " ;
278278 }
279279
280- override EventUsed onMouseClick (Event event)
280+ override EventUsed onMouseClickedEvent (MouseClickedEvent event)
281281 {
282282 if (! isShown)
283283 show(Mode.multiline);
284284 return EventUsed.yes;
285285 }
286286
287- override EventUsed onKeyDown (Event ev)
287+ override EventUsed onKeyPressedEvent (KeyPressedEvent ev)
288288 {
289- if (ev.keyCode == stringToKeyCode(" escape" ))
289+ if (ev.code == stringToKeyCode(" escape" ))
290290 {
291291 if (_promptDelegate ! is null )
292292 {
@@ -295,7 +295,7 @@ class CommandControl : Widget
295295 hide();
296296 clearCompletions();
297297 }
298- else if (ev.keyCode == stringToKeyCode(" return" ))
298+ else if (ev.code == stringToKeyCode(" return" ))
299299 {
300300 if (_promptDelegate is null )
301301 {
@@ -312,7 +312,7 @@ class CommandControl : Widget
312312 }
313313 }
314314 }
315- else if (ev.mod == 0 && isBufferCycleMode)
315+ else if (ev.modifiers == 0 && isBufferCycleMode)
316316 {
317317 // TODO: Fix hide jumping back to last focus widget since executeCommand may want to change that
318318 // and end cycle buffer mode is changing that.
@@ -326,12 +326,12 @@ class CommandControl : Widget
326326 return EventUsed.yes;
327327 }
328328
329- override EventUsed onKeyUp (Event ev)
329+ override EventUsed onKeyReleasedEvent (KeyReleasedEvent ev)
330330 {
331331 if (_promptCompletionsShown)
332332 updatePromptCompletions();
333333
334- if (ev.mod == 0 && isBufferCycleMode)
334+ if (ev.modifiers == 0 && isBufferCycleMode)
335335 {
336336 endCycleBufferMode();
337337 // hide();
@@ -345,7 +345,7 @@ class CommandControl : Widget
345345
346346 override void draw ()
347347 {
348- if (! visible)
348+ if (! visible || w() == 0 )
349349 return ;
350350
351351 auto tup = completionWidget.bufferView.buffer.lineEndsForLineNumber(completionStyler.lineHighlighted);
@@ -354,9 +354,9 @@ class CommandControl : Widget
354354 super .draw();
355355 }
356356
357- override EventUsed onCommand (Event event)
357+ override EventUsed onCommandEvent (CommandEvent event)
358358 {
359- switch (event.name )
359+ switch (event.commandName )
360360 {
361361 case " edit.commitCompletion" :
362362 if (_promptDelegate is null )
@@ -423,7 +423,7 @@ class CommandControl : Widget
423423 import std.conv ;
424424
425425 int val = 1 ;
426- auto valPtr = event.argument [0 ].peek! string ();
426+ auto valPtr = event.arguments [0 ].peek! string ();
427427 if (valPtr ! is null )
428428 val = (* valPtr).to! int ();
429429
0 commit comments