Skip to content
Snippets Groups Projects
Commit be38761e authored by rswindell's avatar rswindell
Browse files

Created console.clearkeybuffer() method to clear (empty) the keyboard input

buffer.
parent 83d6797a
No related branches found
No related tags found
No related merge requests found
......@@ -1354,6 +1354,18 @@ js_backspace(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return(JS_TRUE);
}
static JSBool
js_clearkeybuf(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
sbbs_t* sbbs;
if((sbbs=(sbbs_t*)JS_GetContextPrivate(cx))==NULL)
return(JS_FALSE);
sbbs->keybufbot=sbbs->keybuftop=0;
return(JS_TRUE);
}
static JSBool
js_getlines(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
......@@ -1646,6 +1658,10 @@ static jsSyncMethodSpec js_console_functions[] = {
,JSDOCSTR("send a destructive backspace sequence")
,315
},
{"clearkeybuffer", js_clearkeybuf, 0, JSTYPE_VOID, JSDOCSTR("")
,JSDOCSTR("clear keyboard input buffer")
,315
},
{0}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment