-1

A window can be moved by holding down CTRL and Mouse1, I would love to deactivate it, or deactivate window moving in general.

My problem is, that I use the CTRL key to mark multiple images in my explorer. After my image is marked, the image is processed in PIL, which takes like 100-200ms. So when the user holds down CTRL and clicks mouse1, the image gets processed in PIL. The user releases mouse1 and moves to the next element, the whole window is moved a fair amount(~100 pixels], where the user is moving the mouse to.(I guess the mouse1 click is still in buffer, and gets not updated to "is_released", while the program is busy)

My code is way to split(multiple files) up and too long to post, but I think my question is pretty straightforward and simple enough. toggle/block/unblock move window ability. Favorably deactivating CTRL-move in general, so the user can still use the titlebar. I searched the docs, and found window.move(), but putting the window back to the original position would not be a pretty solution...lol

Thank you.

Leonick
  • 45
  • 7

1 Answers1

0

Refer PySimpleGUI Call Reference

Option in Window

grab_anywhere_using_control

If True can use CONTROL key + left mouse mouse to click and drag to move the window. DEFAULT is TRUE. Unlike normal grab anywhere, it works on all elements.

window = sg.Window('Title', layout, grab_anywhere_using_control=False)
Jason Yang
  • 11,284
  • 2
  • 9
  • 23
  • THANK YOU SO MUCH. I fixed it 9 out of 10 times with ` import win32api, win32con; win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,0,0) ` before I call the imageupdate function to FORCE mouse1_is released, but yours will be perfect. OMG just wanted to ask where I can find this stuff myself, and until now I thought https://www.pysimplegui.org/en/latest/ is the DOCUMENTQATION but there is more: https://www.pysimplegui.org/en/latest/call%20reference/ lol..I was wondering why I can't seem to find stuff. Less stupid questions from me in the future https://www.pysimplegui.org/en/latest/ – Leonick Nov 08 '22 at 07:06