Sensor(3I)

πŸ’– Sensor(3I) πŸ’–

okay bestie, so this is the Sensor page from the InterViews manual (section 3I, iykyk), and honestly? it's giving "tiny class, big main character energy." ✨


πŸŽ€ NAME πŸŽ€

Sensor β€” describe input interest

like literally, it's how you tell the system which inputs you care about. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

#include <InterViews/sensor.h>

yes bestie, that's it, one include and you're in. πŸ¦‹


✨ DESCRIPTION ✨

A sensor specifies a set of input events to catch.

that's the whole thing fr fr β€” you make a sensor, you tell it what events you're obsessed with, and it catches them for you. no cap. πŸ”₯


πŸ‘‘ PUBLIC OPERATIONS πŸ‘‘

πŸ’œ Sensor()

Create a new sensor that initially will not catch any events.

so a fresh baby sensor is lowkey catching nothing at all. you have to teach it what to want. 🍼


πŸ’œ virtual void motion(boolean)

Specify the sensor should (parameter is true) or should not (parameter is false) catch pointer motion events.

pass true and it's tracking every little wiggle of the pointer. pass false and it's like "motion? never heard of her." πŸ•Ί


πŸ’œ virtual boolean motion()

Return whether the sensor is catching pointer motion events.

the lil vibe check β€” asks the sensor "are you catching motion rn?" and it tells you true or false. πŸ’…


πŸ’œ virtual void key(boolean)

Specify the sensor should (parameter is true) or should not (parameter is false) catch keyboard events.

true = keyboard events are sooo welcome here. false = not interested, don't text. ⌨️


πŸ’œ virtual boolean key()

Return whether the sensor is catching keyboard events.

again, just asking. is it catching keys or is it not. simple as that. πŸŽ€


πŸ’œ virtual void button(boolean, PointerButton = Event::any)

Specify the sensor should (parameter is true) or should not (parameter is false) catch button events. The pointer button may specify a particular button or Event::any (meaning all button events).

so the first arg is your yes/no, and the second one is which button you're talking about β€” you can name a specific one, or just hit it with Event::any and it means all button events. the default is Event::any, so if you don't say anything, it's everybody. πŸ–±οΈβœ¨


πŸ’œ virtual boolean button(PointerButton = Event::any)

Return whether the sensor is catching button events. The pointer button may specify a particular button or Event::any (meaning any of the buttons).

same energy as before β€” you ask, it answers. and again, the default is Event::any, meaning any of the buttons. 🫢


πŸ’œ virtual boolean caught(Event&)

Return whether the sensor is catching the given event.

the moment of truth: hand it an event and it'll tell you if that one's on the list or not. 🎯


πŸ’œ void Catch(EventType)

Express interest in a particular type of event. This function is provided solely for backward compatibility and will be removed in a future version.

⚠️ bestie listen β€” this one is backward compatibility only and will be removed in a future version. it's giving legacy. use it if you must, but don't get attached. πŸ’€

πŸ’œ void CatchButton(EventType, int)

Express interest in a particular type of button event for a specific button. This function is provided solely for backward compatibility and will be removed in a future version.

⚠️ same warning, same fate: backward compatibility only, and it will be removed in a future version. it's a specific button, a specific event type, and a very temporary relationship. πŸ™ˆ

πŸ’œ void Ignore(EventType)

Remove interest in a particular type of event. This function is provided solely for backward compatibility and will be removed in a future version.

⚠️ yes, the "we're so over" function. and yes, backward compatibility only β€” will be removed in a future version. periodt. πŸ’…

πŸ’œ void IgnoreButton(EventType, int)

Remove interest in a particular type of button event for a specific button. This function is provided solely for backward compatibility and will be removed in a future version.

⚠️ last one, same deal: backward compatibility only, will be removed in a future version. block that button's event type and move on. 🌈

🌟 SEE ALSO 🌟

  • Event(3I)

go read that one next bestie, they're literally besties. πŸ’–


and that's the page!! this was the InterViews Reference Manual version of Sensor(3I) β€” mwah, iconic, ate, no crumbs. πŸŽ€βœ¨πŸ’œ