cranvas (version 0.8.5)

common_key_press: Some common processings in the keyboard and mouse events

Description

The key press and release events often involve with setting the selection mode of the brush, the alpha transparency, and deleting selected elements, and so on. Mouse press, release, move and hover are often related to brushing and identifying cases. These functions implement these common processes.

Usage

common_key_press(layer, event, data, meta)
common_key_release(layer, event, data, meta)
common_mouse_press(layer, event, data, meta)
common_mouse_move(layer, event, data, meta)
common_mouse_release(layer, event, data, meta)

Arguments

layer
the layer argument in the event callback
event
the event argument in the event callback
data
the data created by qdata
meta
the meta data for a plot

Value

NULL

Mouse Events

Left click to brush the plot with a rectangle brush, and right click to resize the brush (the cursor shape will become a cross). The middle button is used to toggle between two types of brushes: one type is to keep the brush on the plot when the mouse is released, and the other type is to hide it on mouse release. When the mouse is released, the brush history will be saved (save_brush_history).

Key Events

The keys A, O, X, N and C corresponds to the selection mode AND, OR, XOR, NOT and COMPLEMENT respectively. Plus (+) and Minus (-) can increase or decrease the alpha transparency exponentially. The key Delete will make the selected elements invisible, and F5 makes all the elements visible. The question key (?) toggles the identify mode (on or off). The cross cursor shape (+) indicates it is in the identify mode, and a normal cursor indicates the brush mode. The key S acts like the middle button of the mouse (toggles between two brush types). The key Z toggles the zooming mode under the selection brush. In a key release event, we set the selection mode to 'none'. If PageUp or PageDown is pressed (or equivalently use square brackets [ and ]), we show the brush history step by step.

See Also

brush

Examples

Run this code
## see the source code of qbar() or qparallel()

Run the code above in your browser using DataCamp Workspace