Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Pointer events #800

Merged
merged 10 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import indigo.shared.datatypes.Point
import indigo.shared.datatypes.Rectangle
import indigo.shared.events.GlobalEvent
import indigo.shared.events.MouseEvent
import indigo.shared.events.PointerEvent.PointerDown
import indigo.shared.events.PointerEvent.Down
import indigo.shared.events.PointerEvent.PointerId
import indigo.shared.events.PointerEvent.PointerUp
import indigo.shared.events.PointerEvent.Up
import indigo.shared.events.PointerType
import indigo.shared.input.Pointer
import indigo.shared.input.PointerState
Expand Down Expand Up @@ -108,7 +108,7 @@ class ButtonTests extends munit.FunSuite {
val mouse = new PointerState {
val pointers = new Pointers(
Batch(Pointer(PointerId(1), PointerType.Mouse, Batch.empty, Point(20, 20))),
Batch(PointerDown(20, 20, PointerType.Mouse))
Batch(Down(20, 20, PointerType.Mouse))
)
val pointerType = Some(PointerType.Mouse)
}
Expand All @@ -123,7 +123,7 @@ class ButtonTests extends munit.FunSuite {
val mouse = new PointerState {
val pointers = new Pointers(
Batch(Pointer(PointerId(1), PointerType.Mouse, Batch.empty, Point(20, 20))),
Batch(PointerDown(20, 20, PointerType.Mouse))
Batch(Down(20, 20, PointerType.Mouse))
)
val pointerType = Some(PointerType.Mouse)
}
Expand All @@ -138,7 +138,7 @@ class ButtonTests extends munit.FunSuite {
val mouse = new PointerState {
val pointers = new Pointers(
Batch(Pointer(PointerId(1), PointerType.Mouse, Batch.empty, Point(20, 20))),
Batch(PointerDown(20, 20, PointerType.Mouse))
Batch(Down(20, 20, PointerType.Mouse))
)
val pointerType = Some(PointerType.Mouse)
}
Expand All @@ -151,7 +151,7 @@ class ButtonTests extends munit.FunSuite {
val mouse = new PointerState {
val pointers = new Pointers(
Batch(Pointer(PointerId(1), PointerType.Mouse, Batch.empty, Point(20, 20))),
Batch(PointerDown(20, 20, PointerType.Mouse))
Batch(Down(20, 20, PointerType.Mouse))
)
val pointerType = Some(PointerType.Mouse)
}
Expand All @@ -169,7 +169,7 @@ class ButtonTests extends munit.FunSuite {
val mouse = new PointerState {
val pointers = new Pointers(
Batch(Pointer(PointerId(1), PointerType.Mouse, Batch.empty, Point(20, 20))),
Batch(PointerUp(20, 20, PointerType.Mouse))
Batch(Up(20, 20, PointerType.Mouse))
)
val pointerType = Some(PointerType.Mouse)
}
Expand All @@ -185,7 +185,7 @@ class ButtonTests extends munit.FunSuite {
val mouse = new PointerState {
val pointers = new Pointers(
Batch(Pointer(PointerId(1), PointerType.Mouse, Batch.empty, Point(20, 20))),
Batch(PointerUp(20, 20, PointerType.Mouse))
Batch(Up(20, 20, PointerType.Mouse))
)
val pointerType = Some(PointerType.Mouse)
}
Expand All @@ -201,7 +201,7 @@ class ButtonTests extends munit.FunSuite {
val mouse1 = new PointerState {
val pointers = new Pointers(
Batch(Pointer(PointerId(1), PointerType.Mouse, Batch.empty, Point(20, 20))),
Batch(PointerDown(20, 20, PointerType.Mouse))
Batch(Down(20, 20, PointerType.Mouse))
)
val pointerType = Some(PointerType.Mouse)
}
Expand All @@ -215,7 +215,7 @@ class ButtonTests extends munit.FunSuite {
val mouse3 = new PointerState {
val pointers = new Pointers(
Batch(Pointer(PointerId(1), PointerType.Mouse, Batch.empty, Point(200, 200))),
Batch(PointerUp(200, 200, PointerType.Mouse))
Batch(Up(200, 200, PointerType.Mouse))
)
val pointerType = Some(PointerType.Mouse)
}
Expand All @@ -236,7 +236,7 @@ class ButtonTests extends munit.FunSuite {
val mouse1 = new PointerState {
val pointers = new Pointers(
Batch(Pointer(PointerId(1), PointerType.Mouse, Batch.empty, Point(20, 20))),
Batch(PointerDown(20, 20, PointerType.Mouse))
Batch(Down(20, 20, PointerType.Mouse))
)
val pointerType = Some(PointerType.Mouse)
}
Expand All @@ -250,7 +250,7 @@ class ButtonTests extends munit.FunSuite {
val mouse3 = new PointerState {
val pointers = new Pointers(
Batch(Pointer(PointerId(1), PointerType.Mouse, Batch.empty, Point(200, 200))),
Batch(PointerUp(200, 200, PointerType.Mouse))
Batch(Up(200, 200, PointerType.Mouse))
)
val pointerType = Some(PointerType.Mouse)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import indigo.shared.datatypes.Point
import indigo.shared.datatypes.Rectangle
import indigo.shared.events.GlobalEvent
import indigo.shared.events.MouseEvent
import indigo.shared.events.PointerEvent.PointerDown
import indigo.shared.events.PointerEvent.Down
import indigo.shared.events.PointerEvent.PointerId
import indigo.shared.events.PointerType
import indigo.shared.input.Pointer
Expand Down Expand Up @@ -60,7 +60,7 @@ class HitAreaTests extends munit.FunSuite {
val pointers = new Pointers(
Batch(Pointer(PointerId(1), PointerType.Mouse, Batch(MouseButton.LeftMouseButton), bounds.position)),
Batch(
PointerDown(bounds.position, MouseButton.LeftMouseButton, PointerType.Mouse)
Down(bounds.position, MouseButton.LeftMouseButton, PointerType.Mouse)
)
)
val pointerType = Some(PointerType.Mouse)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class RadioButtonGroupTests extends munit.FunSuite {
val mouse =
new Pointers(
Batch(Pointer(Point(5, 25), PointerType.Mouse, MouseButton.LeftMouseButton)),
Batch(PointerEvent.PointerClick(5, 25, PointerType.Mouse))
Batch(PointerEvent.Click(5, 25, PointerType.Mouse))
)

val actual =
Expand Down Expand Up @@ -155,7 +155,7 @@ class RadioButtonGroupTests extends munit.FunSuite {
val mouse =
new Pointers(
Batch(Pointer(Point(5, 25), PointerType.Mouse, MouseButton.LeftMouseButton)),
Batch(PointerEvent.PointerClick(5, 25, PointerType.Mouse))
Batch(PointerEvent.Click(5, 25, PointerType.Mouse))
)

val actual =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ final class WorldEvents:
val pointerType = e.toPointerType

globalEventStream.pushGlobalEvent(
PointerEnter(
Enter(
position,
buttons,
e.altKey,
Expand Down Expand Up @@ -258,7 +258,7 @@ final class WorldEvents:
val pointerType = e.toPointerType

globalEventStream.pushGlobalEvent(
PointerLeave(
Leave(
position,
buttons,
e.altKey,
Expand Down Expand Up @@ -307,7 +307,7 @@ final class WorldEvents:
)

globalEventStream.pushGlobalEvent(
PointerDown(
Down(
position,
buttons,
e.altKey,
Expand Down Expand Up @@ -357,7 +357,7 @@ final class WorldEvents:
pointerButtons.getOrElse(e.pointerId, Batch.empty).find(_._1 == e.button) match {
case Some((btn, downTime)) if btn == e.button && Date.now() - downTime.getTime() <= clickTimeMs =>
globalEventStream.pushGlobalEvent(
PointerClick(
Click(
position,
buttons,
e.altKey,
Expand Down Expand Up @@ -390,7 +390,7 @@ final class WorldEvents:
)

globalEventStream.pushGlobalEvent(
PointerUp(
Up(
position,
buttons,
e.altKey,
Expand Down Expand Up @@ -437,7 +437,7 @@ final class WorldEvents:
val pointerType = e.toPointerType

globalEventStream.pushGlobalEvent(
PointerMove(
Move(
position,
buttons,
e.altKey,
Expand Down Expand Up @@ -480,7 +480,7 @@ final class WorldEvents:
val pointerType = e.toPointerType

globalEventStream.pushGlobalEvent(
PointerCancel(
Cancel(
position,
buttons,
e.altKey,
Expand Down Expand Up @@ -509,7 +509,7 @@ final class WorldEvents:
val pointerType = e.toPointerType

globalEventStream.pushGlobalEvent(
PointerOut(
Out(
position,
buttons,
e.altKey,
Expand Down
Loading
Loading