mouse_minister

See the User’s Guide for more discussion.


mouse_minister()

mouse_minister

protected, constructor

The constructor sets up various defaults and prepares the object for use. Some things may be changed by the derived class, but this is to prevent you from having to explictly do everything in the derived class.


void button_down (unsigned button, unsigned modifiers)

mouse_minister

protected, virtual

The implementation of this function is to do nothing. It is provided to be defined in a derived class to repond to the higher-level semantics of the situation.

This is called when the mouse button is first pressed. It is called after the active comission has been added and any other internal work has been completed.

See modifiers.


void button_up (bool accept)

mouse_minister

protected, virtual

The implementation of this function is to do nothing. It is provided to be defined in a derived class to repond to the higher-level semantics of the situation.

This is called when the mouse button is released. It will be passed an accept parameter of true if this represents completion of the click action. It will be called with false if this represents cancelling of the click action; e.g the escape key was pressed or the button was released while the pointer was outside the “relative verify” area.


void changed_buttons (unsigned buttons)

mouse_minister

protected, virtual

The implementation of this function is to do nothing. It is provided to be defined in a derived class to repond to the higher-level semantics of the situation.

This is called when additional mouse buttons (other than the button that started the operation and will end the operation when released) are pressed or released. This could be used to provide some kind of chording support, or use of additional mouse buttons as modifiers.


void changed_modifiers (unsigned modifiers)

mouse_minister

protected, virtual

The implementation of this function is to do nothing. It is provided to be defined in a derived class to repond to the higher-level semantics of the situation.

This is called when additonal modifier keys are pressed or released. This allows distinguishing the modifiers used for the original click from those used by the drag, as in Photoshop. You can also note different modifiers for different parts of a drag operation.

See modifiers.


void moved_back_in_range (const WM_MOUSEMOVE_msg&)

void moved_out_of_range (const WM_MOUSEMOVE_msg&)

void moved_statusquo (const WM_MOUSEMOVE_msg&)

mouse_minister

protected, virtual

The implementation of these functions is to do nothing. They are provided to be defined in a derived class to repond to the higher-level semantics of the situation.

Exactly one of these is called for each mouse-move event. Different functions indicate whether the state changed (e.g. for “relative verify”) or not.


schedule_t schedule_base, schedule_active

mouse_minister

protected, data

These specify the schedule value for the commissions added by this class to the message_parliament.

The default value (set by the constructor) for schedule_base is Normal. This value will be used by add for the comission it creates for this object. If you need a different position in the comission list, you can change this value in your derived class.

The schedule_active value is used for adding the commission for the active state handler, when a button is pressed. In should be inserted before the main object comission. However, you don’t have to set this value also when you set schedule_base, because the default (set by the constructor) is a flag indicating that it has not been set. When needed for the first time, it will be generated by applying the low and always operators to the original minister’s priority. You should only need to override this if you are very carefully ordering some comissions.


unsigned trigger_buttons

mouse_minister

protected, data

This value determines which mouse button will trigger the activation of this minister. The default set by the constructor is button 1, the left mouse button (or what the OS is calling the left mouse button based on your control panel and driver settings).

You should not change this value after the minister has been comissioned. This class abstracts out different ways of handling different buttons and besides setting up internal state differences it may request notifications for totally different Windows messages, depending on the buttons specified. So changing this on the fly would probably confuse it or make it not work. You can remove the commission, change things, and add a new commission, if you need to do that.

Each button has its own bit in this value. So, any combination of buttons can be specified by oring the bits together. If multiple buttons are specified, it means that any one of those buttons will activate this object. For example, if you set this value to Button1 and Button3 (0x00000001|0x00000004 = 5) then pressing either the left mouse button or the wheel-button will activate this object, and your code can use the argument passed to button_down to take slightly different actions that share the same code.

buttons

#ValueDescription
10x00000001Left Button
20x00000002Right Button
30x00000004Middle Button / Wheel's button
40x00000008XButton1 on IntelliMouse Explorer
50x00000010XButton2 on IntelliMouse Explorer
60x000000206th mouse button (?)
70x00000040Touched with pen
80x00000080Touched with eraser end of pen
otherAny of the 32 possible button codes can be sent using a WM_TOMAHAWK message.

unsigned trigger_modifiers

mouse_minister

protected, data

The modifiers are bits that specify modifier keys that are available to modifiy the action performed by this click. For example, Shift-click or Alt-click.

This value specifies which modifiers must be used in order to activate this minister when the mouse button is pressed. For example, if trigger_modifiers is set to Shift, then pressing the button (specified by trigger_button) will be ignored by this object unless one of the Shift keys is also depressed.

These bits specify the required modifiers, and additional modifiers that are actually present will have no further effect. If the trigger_modifiers is set to Shift and no other bits, then the presence of an Alt key will not disqualify the match. In fact, the matching code is lazy about figuring out which modifiers are invoked, and won’t even notice whether Alt is pressed or not. So, it is important to give the Shift-click a lower schedule number than the plain click. Likewise, Shift-Alt-click needs to be lower still, so it is checked first.

The default value of trigger_modifiers set by the constructor is zero, which indicates that no modifiers are required.

modifiers

To Be Determined

ValueDescription
0x00000001Shift
0x00000002Left Shift
0x00000004Right Shift
0x00000008Ctrl
0x00000010Left Ctrl
0x00000020Right Ctrl
0x00000040Alt