| @@ -50,8 +50,8 @@ public: | |||||
| if (Component* const comp = Desktop::getInstance().findComponentAt (screenPos.roundToInt())) | if (Component* const comp = Desktop::getInstance().findComponentAt (screenPos.roundToInt())) | ||||
| if (ComponentPeer* const peer = comp->getPeer()) | if (ComponentPeer* const peer = comp->getPeer()) | ||||
| if (! peer->isFocused()) | if (! peer->isFocused()) | ||||
| peer->handleMouseEvent (0, peer->globalToLocal (screenPos), mods, | |||||
| MouseInputSource::invalidPressure, Time::currentTimeMillis()); | |||||
| peer->handleMouseEvent (MouseInputSource::InputSourceType::mouse, peer->globalToLocal (screenPos), mods, | |||||
| MouseInputSource::invalidPressure, MouseInputSource::invalidOrientation, Time::currentTimeMillis()); | |||||
| } | } | ||||
| } | } | ||||
| @@ -574,7 +574,9 @@ MouseInputSource& MouseInputSource::operator= (const MouseInputSource& other) no | |||||
| } | } | ||||
| MouseInputSource::InputSourceType MouseInputSource::getType() const noexcept { return pimpl->inputType; } | MouseInputSource::InputSourceType MouseInputSource::getType() const noexcept { return pimpl->inputType; } | ||||
| bool MouseInputSource::isMouse() const noexcept { return (getType() == MouseInputSource::InputSourceType::mouse); } | |||||
| bool MouseInputSource::isTouch() const noexcept { return (getType() == MouseInputSource::InputSourceType::touch); } | bool MouseInputSource::isTouch() const noexcept { return (getType() == MouseInputSource::InputSourceType::touch); } | ||||
| bool MouseInputSource::isPen() const noexcept { return (getType() == MouseInputSource::InputSourceType::pen); } | |||||
| bool MouseInputSource::canHover() const noexcept { return ! isTouch(); } | bool MouseInputSource::canHover() const noexcept { return ! isTouch(); } | ||||
| bool MouseInputSource::hasMouseWheel() const noexcept { return ! isTouch(); } | bool MouseInputSource::hasMouseWheel() const noexcept { return ! isTouch(); } | ||||
| int MouseInputSource::getIndex() const noexcept { return pimpl->index; } | int MouseInputSource::getIndex() const noexcept { return pimpl->index; } | ||||
| @@ -48,7 +48,7 @@ | |||||
| class JUCE_API MouseInputSource | class JUCE_API MouseInputSource | ||||
| { | { | ||||
| public: | public: | ||||
| /** Possible mouse input sources */ | |||||
| /** Possible mouse input sources. */ | |||||
| enum InputSourceType | enum InputSourceType | ||||
| { | { | ||||
| mouse, | mouse, | ||||
| @@ -66,11 +66,18 @@ public: | |||||
| bool operator!= (const MouseInputSource& other) const noexcept { return pimpl != other.pimpl; } | bool operator!= (const MouseInputSource& other) const noexcept { return pimpl != other.pimpl; } | ||||
| //============================================================================== | //============================================================================== | ||||
| /** Returns the type of input source that this object represents */ | |||||
| /** Returns the type of input source that this object represents. */ | |||||
| MouseInputSource::InputSourceType getType() const noexcept; | MouseInputSource::InputSourceType getType() const noexcept; | ||||
| /** Returns true if this object represents a normal desk-based mouse device. */ | |||||
| bool isMouse() const noexcept; | |||||
| /** Returns true if this object represents a source of touch events. */ | |||||
| bool isTouch() const noexcept; | bool isTouch() const noexcept; | ||||
| /** Returns true if this object represents a pen device. */ | |||||
| bool isPen() const noexcept; | |||||
| /** Returns true if this source has an on-screen pointer that can hover over | /** Returns true if this source has an on-screen pointer that can hover over | ||||
| items without clicking them. | items without clicking them. | ||||
| */ | */ | ||||