I am working on a tool to extend the functionality of links. We can make use of the modifier keys such as shift, alt , ctrl and meta when processing the click action.
If however you first hold a modifier key you will see the tooltip value will not be displayed. It would be nice to be able to set a different tooltip for each modifier key. I think to add these as attributes to the button widget etc… would make the attributes too complex, but I believe there may be a way to use CSS to set the tooltip values based on the modifier keys.
Can any one suggest “How to” or the CSS method to use, perhaps in a class.
mouseover is a bubbling event. $eventcatcher handles bubbling events and provides a modifier attribute to tell you which modifier key was held down during the event.
However, I don’t see how to change an HTML title attribute (where widget tooltips end up) using CSS.
That said, I’m increasingly blown away by some of the CSS gimmickry I see posted on the web - might be possible for a true CSS guru.
Thanks, that is workaround. However the buttons include an increasing amount of code so I would be keen to keep the bytes low, especially since it will appear on every item in a list.
As soon as eventcatcher and message catcher was made available i looked but there is little or no explanation or documentation and depends on prior knowledge or developer insight.
Let me know if any of this is not clear – you only need to watch for $eventcatcher, the <button> element and the actions macro that uses the <<dom-*>> variables:
Yes. To make use of the modifier variables I use list widgets to conditionaly display action widgets inside a trigger eg button widget actions= macro or the body of the button.
<$list filter="[<modifier>match[normal]]" variable=nul>
Action widgets for no modifier here
</$list>
Replace normal with ctrl etc…
On click of the button the modifier variable is set and the action widgets that would be displayed if they were normal wiki text will be actioned.