when press shift hover to show tooltip

Hi , I am trying to implement hover tooltip when only press shift , any idea how I can do that and leverage the existing hovertooltip extension?

Also how may I get the token from the editor on a particular position in codemirror 6?
I was using something like :
editor.getTokenAt(pos, true);

You could track the status of the shift key in a view plugin, and query that in the callback you give to hoverTooltip.

The 6.x architecture stores a syntax tree, not just a sequence of tokens, so you may need to reframe your query in terms of that. syntaxTree(state).resolveInner(pos, side) is how you find the node at a given position in the tree.

Thanks. Is there any sample code?