MBS Quicklook Panel Question

I have a listbox with a list of files from a folder. I’m using the Quicklook Panel example as a way to create quicklook previews of selected files when pressing the spacebar.

I get the preview showing up with the file(s) selected, but the window with the listbox loses the focus, so I can’t use the keyboard to move up and down the listbox to change the image in the QL preview.

If you use Quicklook in a finder window, the finder window doesn’t lose the focus, and you can use the up/down arrows to change the image in the QL Preview window.

Any ideas on how to do this without the application window and listbox losing the focus, or is there way to get the QL panel to switch the focus back to the window without having to click on the window?

2 Likes

Well, the panel should be a floating window and not steal focus. I’ll check if it happens here.

I can confirm I get the same behaviour in one of my apps.

please implement the HandleEvent event. You can catch the event there:

if e.type = NSEventMBS.NSKeyDown then
  
  if e.keyCode = 125 then
    System.DebugLog "cursor down pressed"
  elseif e.keyCode = 126 then
    System.DebugLog "cursor up pressed"
  end if
  
else
  
  if e.keyCode = 125 then
    System.DebugLog "cursor down released"
  elseif e.keyCode = 126 then
    System.DebugLog "cursor up released"
  end if
  
end if


Return false
1 Like

Thank you! I’m able to scroll up and down a file list with the arrow keys and update the preview!

1 Like