Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
152 views
in Technique[技术] by (71.8m points)

javascript - Are there pointerout-like events when hitting Chrome breakpoints?

I have a browser program that performs certain actions if a mouse button is held down. To accomplish this, the program listens for pointerdown and pointerup events on the document object. When receiving these events, the program sets (or unsets) some flags that track button-held state. There are a number of other input events that should also unset a button-held flag, like focusout and pointerout.

Browser breakpoints seem to be a grey area. In Firefox, holding the mouse down and triggering a breakpoint causes the pointerout event to get fired, which lets me properly unset button-held flags. However, Chrome (87.0.4280.88, Mac OS) does not appear to fire any of blur, pointerout, mouseout, or focusout when hitting a breakpoint. The result is that after I've resumed normal execution, my program code still thinks a mouse button is held down until I click again in the browser window.

Is there a workaround for this? There doesn't appear to be any way to directly poll the state of the mouse, so it seems I need to rely completely on events to drive this.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...