media.showSoftKeyboard - GiGAGenie-ServiceSDK/UserGuide GitHub Wiki

gigagenie.media.showSoftKeyboard

API ์„ค๋ช…

  • ์†Œํ”„ํŠธ ํ‚ค๋ณด๋“œ ํ‘œ์‹œ API
  • ํ™”๋ฉด์— ์†Œํ”„ํŠธํ‚ค๋ณด๋“œ๋ฅผ ํ‘œ์‹œํ•จ
  • Google GBoard์— ์ตœ์ ํ™”๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ํ‚ค๋ณด๋“œ ์‚ฌ์šฉ์‹œ ์ •์ƒ๋™์ž‘ํ•˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • options.mode ๊ฐ’์€ optional์ด๋‚˜, 1 ๊ฐ’์„ ์„ธํŒ…ํ•˜์—ฌ ์ „๋‹ฌํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•จ
  • ์†Œํ”„ํŠธ ํ‚ค๋ณด๋“œ์—์„œ ์ˆ˜์‹ ํ•œ ํ‚ค๋ณด๋“œ ๊ฐ’์€ JavaScript ์—์„œ ์ œ๊ณตํ•˜๋Š” ํ‚ค๋ณด๋“œ ๊ด€๋ จ ์ด๋ฒคํŠธ๋กœ 3rd party ์„œ๋น„์Šค์—์„œ ์ง์ ‘ ์ฒ˜๋ฆฌํ•ด์•ผ ํ•จ
  • ํ•œ๊ธ€ ์‚ฌ์šฉ์‹œ keyevent๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— onSoftKeyEvent ์‚ฌ์šฉํ•ด ์›น์•ฑ์—์„œ ์ง์ ‘ ์ฒ˜๋ฆฌํ•ด์•ผ ํ•จ(onSoftKeyEvent API ์ฐธ๊ณ )
  • <input> ํƒœ๊ทธ๋ฅผ ํฌํ•จํ•˜๋Š” ์š”์†Œ์— ํฌ์ปค์Šค๋  ๊ฒฝ์šฐ ์ž๋™์ ์œผ๋กœ SoftKeyboard๊ฐ€ ์˜ฌ๋ผ์˜ค๋ฉฐ, ์˜ฌ๋ผ์˜จ ํ‚ค๋ณด๋“œ์˜ ์–ธ์–ด ์„ค์ •์€ mode ๋กœ ์ฒ˜๋ฆฌํ•˜๋ฉด ๋จ
    • showFlag ๋ฅผ false ๋กœ ์„ค์ •ํ•˜๊ณ  mode ๋ฅผ 1 ๋กœ ์„ค์ •ํ•˜๋ฉด <input> ์š”์†Œ์— ํฌ์ปค์‹ฑ๋  ๋•Œ ํ•œ๊ธ€ ํ‚ค๋ณด๋“œ๊ฐ€ ๊ธฐ๋ณธ ๊ฐ’์œผ๋กœ ๋ณด์—ฌ์ง

API ๊ตฌ์กฐ

  • function showSoftKeyboard(options,callback)
  • options
    • showFlag: (Boolean, Mandatory) Softkeyboard ํ‘œ์‹œ ์—ฌ๋ถ€
    • mode: (Int, Optional) Default keyboard ์„ธํŒ… ๊ฐ’์œผ๋กœ ๋‹ค์Œ ๋‘ ๊ฐ’ ์ค‘ ํ•˜๋‚˜์˜ ๊ฐ’์„ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์Œ
      • 0: ์˜์–ด ํ‚ค๋ณด๋“œ(default)
      • 1: ํ•œ๊ธ€ ํ‚ค๋ณด๋“œ
    • inputmode: (Int, Optional) ๊ธฐ๋ณธ ํ‚ค๋ณด๋“œ ๋ฐ ๊ฐ€์ƒ ํ‚ค๋ณด๋“œ ์„ค์ •์„ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์Œ
      • 0: ๊ธฐ๋ณธ ํ‚ค๋ณด๋“œ(default)
      • 1: ํ•œ๊ธ€ ์ž…๋ ฅ์„ onSoftKeyEvent๋กœ ๋ฐ›๋Š” ์˜ต์…˜(์‚ฌ์šฉ ํ›„ ์›๋ณต ํ•„์š”)
  • result_cd
    • 200: ์„ฑ๊ณต
    • 500: ์‹œ์Šคํ…œ Error
  • extra: null

์‚ฌ์šฉ ์˜ˆ์‹œ

// input tag ์ง์ ‘ ์ ‘๊ทผ์ด ๋ถˆ๊ฐ€ํ•  ๋•Œ ์‚ฌ์šฉ
var options = {};
options.showFlag = true;
options.mode = 1;
options.inputmode = 1;
gigagenie.media.showSoftKeyboard(options, function (result_cd, result_msg, extra) {
    if (result_cd === 200) {
        console.log("showSoftKeyboard Success..");
    } else {
        console.log("showSoftKeyboard Fail");
    }
});

//๊ธฐ๋ณธ ํ‚ค๋ณด๋“œ ์ž…๋ ฅ ๋ฐฉ์‹์œผ๋กœ ์›๋ณต
var options = {};
options.showFlag = false;
options.mode = 1;
options.inputmode = 0;
gigagenie.media.showSoftKeyboard(options, function (result_cd, result_msg, extra) {
    if (result_cd === 200) {
        console.log("showSoftKeyboard Success..");
    } else {
        console.log("showSoftKeyboard Fail");
    }
});

โš ๏ธ **GitHub.com Fallback** โš ๏ธ