update to include focus and caret tracking