๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
IT-Engineering

ํ‹ฐ์Šคํ† ๋ฆฌ ๊ธ€์“ฐ๊ธฐ ๋‹จ์ถ•ํ‚ค ์ถ”๊ฐ€(์‹ ๊ทœ ์—๋””ํ„ฐ)

by ๐Ÿงž‍โ™‚๏ธ 2020. 3. 3.
๋ฐ˜์‘ํ˜•

https://truemooon.tistory.com/12

 

ํ‹ฐ์Šคํ† ๋ฆฌ: ์ถ”๊ฐ€ ๋‹จ์ถ•ํ‚ค ์„ค์ •ํ•˜๊ธฐ

์˜ค๋Š˜์€ ํ‹ฐ์Šคํ† ๋ฆฌ ๋ธ”๋กœ๊ทธ์— ๊ฐ„๋‹จํ•˜๊ฒŒ ๋‹จ์ถ•ํ‚ค ์„ค์ •์„ ์ถ”๊ฐ€ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๊ณต์œ ํ•˜๊ณ ์ž ํ•œ๋‹ค. ์˜์™ธ๋กœ ๋ชจ๋ฅด๋Š” ์‚ฌ๋žŒ๋“ค์ด ๊ฝค ์žˆ์ง€๋งŒ, ์‚ฌ์‹ค ํ‹ฐ์Šคํ† ๋ฆฌ์—๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ์„ค์ •๋˜์–ด ์žˆ๋Š” ๋‹จ์ถ•ํ‚ค๊ฐ€ ์žˆ๋‹ค. Q: ๊ด€๋ฆฌ ํŽ˜์ด์ง€ / ๋ธ”๋กœ๊ทธ..

truemooon.tistory.com

์˜ˆ์ „์— W๋ฅผ ๋ˆŒ๋Ÿฌ์„œ ๊ธ€์„ ์ž‘์„ฑํ•˜๊ณ  ํ–ˆ๋˜ ๊ธฐ์–ต์ด ์žˆ์–ด์„œ ์œ„์˜ ๋ธ”๋กœ๊ทธ๋ฅผ ์ฐธ์กฐํ•˜์—ฌ ์ƒˆ๋กœ์ด ์„ค์ •ํ–ˆ๋‹ค.

์Šคํ‚จ ํŽธ์ง‘ - HTML์—์„œ <head> ... </head> ์˜ head์‚ฌ์ด์ธ ... ๋‚ด๋ถ€์— ์•„๋ž˜์˜ ์ฝ”๋“œ๋ฅผ ์ถ”๊ฐ€ํ•˜๋ฉด

'w'๋ฅผ ์ด์šฉํ•œ ๊ธ€์“ฐ๊ธฐ ๋‹จ์ถ•ํ‚ค๋ฅผ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ๋‹ค.

<script type="text/javascript"> 
var key = new Array(); 
key['w'] = "/manage/newpost";

function getKey(keyStroke) {
 if ((event.srcElement.tagName != 'INPUT') && (event.srcElement.tagName != 'TEXTAREA')){
  isNetscape=(document.layers);
  eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
  which = String.fromCharCode(eventChooser).toLowerCase();
  for (var i in key)
   if (which == i) window.location = key[i];
 }
}
document.onkeypress = getKey;
</script>
๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€