Closing as not a bug: this example is working as intended. The 'On key pressed' triggers run outside of the normal event loop; by the time "Group" runs in normal event evaluation, the local variable resets itself to its initial value, which is by design (since it is non-static). Workaround: make it a static local variable.