Skip to content

Instantly share code, notes, and snippets.

@lukpazera
Created June 10, 2019 08:34
Show Gist options
  • Save lukpazera/eaffdcdf9e87f5f4e582608f25f5b0a9 to your computer and use it in GitHub Desktop.
Save lukpazera/eaffdcdf9e87f5f4e582608f25f5b0a9 to your computer and use it in GitHub Desktop.
A method to track input for tool events, thought it might be useful to others.
void input_testing(ILxUnknownID vts)
{
// setup
CLxUser_VectorStack vec(vts);
LXpToolInputEvent *input_event;
input_event = (LXpToolInputEvent *)vec.Read(offset_input);
// Tool Input Count(could be used to track number of clicks etc)
int count = input_event->count;
// Tracks whether tool is hauling
int haul = input_event->haul;
// Ouputs 0 or 1 for Left Mouse or Right Mouse respectively, <LXfTMOD_I0_INPUT> <LXfTMOD_I1_INPUT> both need to be set
int input = input_event->input;
// Outputs Different Numbers based on whether Ctrl, Shift or a Combination is held down.
int mode = input_event->mode;
// Test for handle hitting.
int part = input_event->part;
// Not Sure what this is for, I think it shows type of tool, normal, brush etc.
int type = input_event->type;
//Output
my_log.Info("Input Count: " + toString(count));
my_log.Info("Input Haul: " + toString(haul));
my_log.Info("Input Input: " + toString(input));
my_log.Info("Input Mode: " + toString(mode));
my_log.Info("Input Part: " + toString(part));
my_log.Info("Input Type: " + toString(type));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment