feat(tray-specific): ✨ Add system tray event listeners (click/hover) for desktop app notifications and right-click menus
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
2e4b09d86f
commit
4c4f3b5744
1 changed files with 8 additions and 6 deletions
|
|
@ -164,6 +164,9 @@ func _handle_command(msg: Dictionary) -> void:
|
|||
_respond({"mic_enabled": mic._enabled})
|
||||
else:
|
||||
_respond({"error": "Microphone not found"})
|
||||
"camera_list":
|
||||
var cameras: Array = msg.get("cameras", [])
|
||||
EventBus.camera_list_updated.emit(cameras)
|
||||
"state_get":
|
||||
_handle_state_get(msg)
|
||||
"state_set":
|
||||
|
|
@ -177,9 +180,6 @@ func _handle_envelope(msg: Dictionary) -> void:
|
|||
match event_type:
|
||||
"chobit.face.tracked":
|
||||
_handle_face(payload)
|
||||
"chobit.camera.list":
|
||||
var cameras: Array = payload.get("cameras", [])
|
||||
EventBus.camera_list_updated.emit(cameras)
|
||||
|
||||
|
||||
func _handle_face(payload: Dictionary) -> void:
|
||||
|
|
@ -196,6 +196,11 @@ func _handle_face(payload: Dictionary) -> void:
|
|||
var pos := Vector2(float(face_x), float(face_y))
|
||||
EventBus.face_detected.emit(pos)
|
||||
|
||||
if head_yaw != null and head_pitch != null and iris_h != null and iris_v != null:
|
||||
EventBus.face_pose_updated.emit(
|
||||
float(head_yaw), float(head_pitch), float(iris_h), float(iris_v)
|
||||
)
|
||||
|
||||
if _gaze_controller != null:
|
||||
if attention == "looking":
|
||||
# User is looking at Miku — Miku looks back at the user.
|
||||
|
|
@ -230,9 +235,6 @@ func _handle_face(payload: Dictionary) -> void:
|
|||
var iris_v_deg := (float(iris_v) - 0.5) * 60.0 # iris [0..1] → ±30°
|
||||
var comp_yaw := float(head_yaw) * 0.7 + iris_h_deg * 0.3
|
||||
var comp_pitch := float(head_pitch) * 0.7 + iris_v_deg * 0.3
|
||||
EventBus.face_pose_updated.emit(
|
||||
float(head_yaw), float(head_pitch), float(iris_h), float(iris_v)
|
||||
)
|
||||
# Normalize to -1..1 (±35° yaw covers full gaze range, ±20° pitch)
|
||||
var gaze_x := clampf(comp_yaw / 35.0, -1.0, 1.0)
|
||||
var gaze_y := clampf(-comp_pitch / 20.0, -1.0, 1.0) # invert: up pitch = up gaze
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue