Hi,

I like the feature named pointermode of XTerm to hide the mouse pointer
while typing. I would like to have it in conkeror, too. This is my stupid
attempt:

// Hide the mouse pointer after a keypress and show it again when the mouse
// moved.
add_hook("keypress_hook", function (event) {
    var buf = get_recent_conkeror_window().buffers.current;
    var old_cursor = buf.document.body.style.cursor;
    if (old_cursor == 'none')
        return;

    var show_mouse_func = function (ev) {
        // dumpln("mouse event: " + ev.type);
        if (! 'body' in ev.target.ownerDocument)
            return;

        var style = ev.target.ownerDocument.body.style;
        if ('old_cursor' in style)
        {
            dumpln("mouse shown: " + style.old_cursor);
            style.cursor = style.old_cursor;
            delete style.old_cursor;
        }
        // buf.browser.removeEventListener(show_mouse_func);
    };

    buf.browser.addEventListener("mouseover", show_mouse_func, false);
    buf.browser.addEventListener("mouseout", show_mouse_func, false);
    buf.document.body.style.old_cursor = buf.document.body.style.cursor;
    buf.document.body.style.cursor = 'none';
    dumpln("mouse hidden");
}, true);

I'm not very familiar with conkeror's internals and javascipt. Can
someone beautify my attempt or tell me how I should do it?

Thanks in advance, Jörg.
-- 
Diskusion „Pascal vs. Rest der Welt“:
30 Aug 2000 00:13:11 GMT, Adrian Knoth <[email protected]>
Und selbst wenn eure 100000 Zeilen‐Programme noch so oft unter Windows
verwendet werden: mit einem Handwagen fährt man nicht Formel‐1.
_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror

Reply via email to