francejs / effroi

Codename : effroi
MIT License
27 stars 6 forks source link

Navigation API #5

Open nfroidure opened 10 years ago

nfroidure commented 10 years ago

The key board and the mouse allow to navigate throught the document giving focus to particular elements. Here is a suggestion to implement it :

// hit tab/shift tab
keyboard.tab();
keyboard.revTab();
// Hit tab/shift tab until element is focused (may fail)
keyboard.tabTo(element);
keyboard.revTabTo(element);

We have to fire focus/blur events according to what the browser do.

mouse.move(element);
mouse.moveTo(x, y);
mouse.focus(element); // click on an element and release on its parent