<commit_before>"
I am an event processor.
I convert basic events to more complex events.
For example, i generate events like click, dbl click, drag&drop, ... from mouse down, mouse up, and mouse move events.

Mouse actions are blocked during drag
"
Class {
	#name : #BlMouseProcessor,
	#superclass : #BlBaseEventProcessor,
	#instVars : [
		'lastEnteredTargets',
		'lastOverTarget',
		'lastClickEvent',
		'isMouseStillDown',
		'currentDragTarget',
		'lastMouseTarget',
		'dndInProgress',
		'currentEnteredTargets',
		'dragStartMask',
		'pressedButtons',
		'dragState',
		'previousMouseDownEvent'
	],
	#category : #'Bloc-Space - Events'
}

{ #category : #'event testing' }
BlMouseProcessor >> canBeClickEvent: aMouseUpEvent [
	^ dndInProgress not
		and: [ (previousMouseDownEvent isNotNil and: [ previousMouseDownEvent primaryButtonPressed ])
				and: [ aMouseUpEvent target = previousMouseDownEvent target ] ]
]

{ #category : #'event testing' }
BlMouseProcessor >> canBeDblClickEvent: aMouseUpEvent [
	^ ((self canBeClickEvent: aMouseUpEvent) and:[lastClickEvent isNotNil])
		and: [ aMouseUpEvent timestamp - lastClickEvent timestamp < self dblClickDelay ]
]<commit_msg>fix detection of double click event by adding  same target detection [feenkcom/gtoolkit#670]<commit_after>"
I am an event processor.
I convert basic events to more complex events.
For example, i generate events like click, dbl click, drag&drop, ... from mouse down, mouse up, and mouse move events.

Mouse actions are blocked during drag
"
Class {
	#name : #BlMouseProcessor,
	#superclass : #BlBaseEventProcessor,
	#instVars : [
		'lastEnteredTargets',
		'lastOverTarget',
		'lastClickEvent',
		'isMouseStillDown',
		'currentDragTarget',
		'lastMouseTarget',
		'dndInProgress',
		'currentEnteredTargets',
		'dragStartMask',
		'pressedButtons',
		'dragState',
		'previousMouseDownEvent'
	],
	#category : #'Bloc-Space - Events'
}

{ #category : #'event testing' }
BlMouseProcessor >> canBeClickEvent: aMouseUpEvent [
	^ dndInProgress not
		and: [ (previousMouseDownEvent isNotNil and: [ previousMouseDownEvent primaryButtonPressed ])
				and: [ aMouseUpEvent target = previousMouseDownEvent target ] ]
]

{ #category : #'event testing' }
BlMouseProcessor >> canBeDblClickEvent: aMouseUpEvent [
	^ (self canBeClickEvent: aMouseUpEvent) 
		and: [ lastClickEvent isNotNil
			and: [ aMouseUpEvent target = lastClickEvent target 
				and: [ aMouseUpEvent timestamp - lastClickEvent timestamp < self dblClickDelay ] ] ]
]
{'fraction_non_alphanumeric': 0.10390656463954893, 'fraction_numerical': 0.0012082158679017317, 'mean_word_length': 5.21, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3204060', 'n_tokens_mistral': 815, 'n_tokens_neox': 771, 'n_words': 211}