Archicad 28 C++ API
Loading...
Searching...
No Matches
ACAPI::v1::InputHandler Class Reference

A class to handle input related operations, like manipulating the input position and starting an input. More...

#include <InputHandler.hpp>

Inheritance diagram for ACAPI::v1::InputHandler:
ACAPI::v1::Object

Public Member Functions

Result< API_Coord3DGetInputPosition () const
 A function to get the current input position in model coordinates.
 
Result< void > SetInputPosition (const API_Coord3D &position, bool withCursor) const
 Sets the current input position with or without the cursor.
 
Result< void > ApplyInputPosition () const
 Applies the current input position by performing a mouse click at it.
 
- Public Member Functions inherited from ACAPI::v1::Object
 Object (std::shared_ptr< Impl::ObjectImpl > impl)
 Constructs a new object.
 
const API_TokenGetToken () const
 Get the token for this object.
 

Friends

Result< InputHandlerCreateInputHandler ()
 A function to create an InputHandler instance, that lets you handle input related operations.
 

Additional Inherited Members

- Protected Member Functions inherited from ACAPI::v1::Object
 ~Object ()
 Default destructor.
 
- Protected Attributes inherited from ACAPI::v1::Object
std::shared_ptr< Impl::ObjectImplmImpl
 Impl object given by constructor.
 

Detailed Description

A class to handle input related operations, like manipulating the input position and starting an input.

Since
Archicad 28

Member Function Documentation

◆ ApplyInputPosition()

Result< void > ACAPI::v1::InputHandler::ApplyInputPosition ( ) const

Applies the current input position by performing a mouse click at it.

Returns
Returns an error if the input above the current front window is not applicable, otherwise nothing.
  • APIERR_BADWINDOW - the operation cannot be performed in the current front window of the application. Currently only the floorplan (APIWind_FloorPlanID) is supported

◆ GetInputPosition()

Result< API_Coord3D > ACAPI::v1::InputHandler::GetInputPosition ( ) const

A function to get the current input position in model coordinates.

Returns
Returns the input position in 3D coordinates.
Remarks
The input position can be different from the cursor's position, because:
  • The input position snaps to nearby elements
  • The input position can be set without moving the cursor's position

◆ SetInputPosition()

Result< void > ACAPI::v1::InputHandler::SetInputPosition ( const API_Coord3D position,
bool  withCursor 
) const

Sets the current input position with or without the cursor.

Parameters
position[in] The 3D coordinate of the new position.
withCursor[in] Sets if the cursor is needed to be moved to the new position.
Returns
Returns an error if setting the input position above the current front window is not applicable, otherwise nothing.
  • APIERR_BADWINDOW - the operation cannot be performed in the current front window of the application. Currently only the floorplan (APIWind_FloorPlanID) is supported

Friends And Related Symbol Documentation

◆ CreateInputHandler

Result< InputHandler > CreateInputHandler ( )
friend

A function to create an InputHandler instance, that lets you handle input related operations.

Returns
Returns the InputHandler instance. This process cannot fail.