MCPcopy Create free account
hub / github.com/kiibohd/controller / Pixel_determineLastTriggerScanCode

Function Pixel_determineLastTriggerScanCode

Macro/PixelMap/pixel.c:2577–2602  ·  view source on GitHub ↗

Looks up the final scancode in a trigger macro

Source from the content-addressed store, hash-verified

2575
2576// Looks up the final scancode in a trigger macro
2577uint8_t Pixel_determineLastTriggerScanCode( TriggerMacro *trigger )
2578{
2579 // Ignore (set to zero) if unset
2580 if ( trigger == 0 )
2581 {
2582 return 0;
2583 }
2584
2585 // Iterate over each TriggerGuide element
2586 uint8_t curScanCode = 0;
2587 for ( var_uint_t pos = 0; ; pos += trigger->guide[ pos ] * TriggerGuideSize + 1 )
2588 {
2589 // Length of this combo
2590 uint8_t comboLength = trigger->guide[ pos ] * TriggerGuideSize;
2591
2592 // Determine scancode, use first TriggerGuide scanCode
2593 TriggerGuide *guide = (TriggerGuide*)&trigger->guide[ pos + 1 ];
2594 curScanCode = guide->scanCode;
2595
2596 // If this combo has zero length, we are at the end
2597 if ( trigger->guide[ pos + comboLength + 1 ] == 0 )
2598 {
2599 return curScanCode;
2600 }
2601 }
2602}
2603
2604// External Animation Control
2605void Pixel_setAnimationControl( AnimationControl control )

Callers 1

Pixel_fillPixelLookupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…