Cara Disable Fungsi Keyboard dengan Pesanmu

by K A L L E N
Let's Share, nyaan! (。•ㅅ•。) :
Konbanwa!
Sama seperti sebelumnya men-disable fungsi keyboard, tapi kali ini bukan dengan menggunakan blog jebakan melainkan tulisan!
contohnya iniii kalo nyoba pencet F12 dkk!

Kode-kode blog ini untuk mendisable

  • CTRL+U
  • CTRL+S
  • CTRL+A
  • CTRL+T
  • CTRL+SHIFT+K
  • F12

Langsung aja ke Template > Edit HTML
copy kode ini, lalu paste DIATAS </head>

<script type='text/javascript'>
//<![CDATA[
shortcut = {
  all_shortcuts: {},
  add: function (e, t, n) {
    var r = {
      type: "keydown",
      propagate: !1,
      disable_in_input: !1,
      target: document,
      keycode: !1
    };
    if (n) for (var i in r) "undefined" == typeof n[i] && (n[i] = r[i]);
    else n = r;
    r = n.target, "string" == typeof n.target && (r = document.getElementById(n.target)), e = e.toLowerCase(), i = function (r) {
      r = r || window.event;
      if (n.disable_in_input) {
        var i;
        r.target ? i = r.target : r.srcElement && (i = r.srcElement), 3 == i.nodeType && (i = i.parentNode);
        if ("INPUT" == i.tagName || "TEXTAREA" == i.tagName) return
      }
      r.keyCode ? code = r.keyCode : r.which && (code = r.which), i = String.fromCharCode(code).toLowerCase(), 188 == code && (i = ","), 190 == code && (i = ".");
      var s = e.split("+"),
        o = 0,
        u = {
          "`": "~",
          1: "!",
          2: "@",
          3: "#",
          4: "$",
          5: "%",
          6: "^",
          7: "&",
          8: "*",
          9: "(",
          0: ")",
          "-": "_",
          "=": "+",
          ";": ":",
          "'": '"',
          ",": "<",
          ".": ">",
          "/": "?",
          "\\": "|"
        }, f = {
          esc: 27,
          escape: 27,
          tab: 9,
          space: 32,
          "return": 13,
          enter: 13,
          backspace: 8,
          scrolllock: 145,
          scroll_lock: 145,
          scroll: 145,
          capslock: 20,
          caps_lock: 20,
          caps: 20,
          numlock: 144,
          num_lock: 144,
          num: 144,
          pause: 19,
          "break": 19,
          insert: 45,
          home: 36,
          "delete": 46,
          end: 35,
          pageup: 33,
          page_up: 33,
          pu: 33,
          pagedown: 34,
          page_down: 34,
          pd: 34,
          left: 37,
          up: 38,
          right: 39,
          down: 40,
          f1: 112,
          f2: 113,
          f3: 114,
          f4: 115,
          f5: 116,
          f6: 117,
          f7: 118,
          f8: 119,
          f9: 120,
          f10: 121,
          f11: 122,
          f12: 123
        }, l = !1,
        c = !1,
        h = !1,
        p = !1,
        d = !1,
        v = !1,
        m = !1,
        y = !1;
      r.ctrlKey && (p = !0), r.shiftKey && (c = !0), r.altKey && (v = !0), r.metaKey && (y = !0);
      for (var b = 0; k = s[b], b < s.length; b++) "ctrl" == k || "control" == k ? (o++, h = !0) : "shift" == k ? (o++, l = !0) : "alt" == k ? (o++, d = !0) : "meta" == k ? (o++, m = !0) : 1 < k.length ? f[k] == code && o++ : n.keycode ? n.keycode == code && o++ : i == k ? o++ : u[i] && r.shiftKey && (i = u[i], i == k && o++);
      if (o == s.length && p == h && c == l && v == d && y == m && (t(r), !n.propagate)) return r.cancelBubble = !0, r.returnValue = !1, r.stopPropagation && (r.stopPropagation(), r.preventDefault()), !1
    }, this.all_shortcuts[e] = {
      callback: i,
      target: r,
      event: n.type
    }, r.addEventListener ? r.addEventListener(n.type, i, !1) : r.attachEvent ? r.attachEvent("on" + n.type, i) : r["on" + n.type] = i
  },
  remove: function (e) {
    var e = e.toLowerCase(),
      t = this.all_shortcuts[e];
    delete this.all_shortcuts[e];
    if (t) {
      var e = t.event,
        n = t.target,
        t = t.callback;
      n.detachEvent ? n.detachEvent("on" + e, t) : n.removeEventListener ? n.removeEventListener(e, t, !1) : n["on" + e] = !1
    }
  }
},
shortcut.add("Ctrl+U", function () {
  alert("TULISAN KAMU");
}), shortcut.add("Ctrl+S", function () {
  alert("
TULISAN KAMU");
}), shortcut.add("Ctrl+A", function () {
  alert("TULISAN KAMU");
}), shortcut.add("Ctrl+T", function () {
  alert("TULISAN KAMU");
}), shortcut.add("Ctrl+Shift+K", function () {
  alert("TULISAN KAMU");
}), shortcut.add("F12", function () {
  alert("TULISAN KAMU");
})
//]]>
</script>
caranya hampir sama aja yang pake gambar, tapi kalo menurut aku ini lebih mudah dan ga ribet hehehe :B
Selamat mencoba! :3

Regards, Kallen.

♫ Thanks for Reading, da. Ctrl + C = COPY! ♫

0 Spam(s) on "Cara Disable Fungsi Keyboard dengan Pesanmu"

Posting Komentar

Rules :
✱ Menggunakan bahasa yang baik, jelas dan benar
✱ Tidak spam
✱ Tidak menyinggung perasaan author maupun orang lain

Regards,
Kallen Beilschmidt ♫

 
H o m e S t u f f s K a l l e n T o m o d a c h i T h a n k s T o F o l l o w +
K a l l e n B e i l s c h m i d t Ⓒ 2 0 1 6