bool Focusable { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Focusable property of the GraphicsItem class indicates whether the item can receive keyboard input. This property is a boolean value, where true means the item is capable of receiving focus and handling keyboard events, while false means it cannot.

Usage

To use the Focusable property, you can simply get or set its value on an instance of GraphicsItem. Setting this property to true allows the item to be focusable, enabling it to handle keyboard input. Conversely, setting it to false will prevent the item from receiving focus.

Example

// Example of setting the Focusable property
GraphicsItem item = new GraphicsItem();
item.Focusable = true; // Enable keyboard input for this item

// Check if the item is focusable
bool canReceiveFocus = item.Focusable;
if (canReceiveFocus)
{
    // Perform actions knowing the item can receive keyboard input
}