질문과 답변

Extra Form

아래가 내용입니다. 그런데 이걸 쓰려면 이벤트>조건분기-스크립트 :

해서 뭘 써야할까요? 전체키 스크립트랑은 조금 틀린것 같은데...

#==============================================================================
# Vampyr Keyboard (Thanks to Aleworks to source)
#==============================================================================
Vampyr_Kernel.register("Vampyr Keyboard", 1.0, "09/01/2009")
#------------------------------------------------------------------------------
module Keys
 
  Keyboard = "PT-BR"
 
  Mouse_Left = 1
  Mouse_Right = 2
  Mouse_Middle = 4
 
  Back = 8
  Tab = 9
  Clear = 12
  Enter = 13
  Shift = 16
  Ctrl = 17
  Alt = 18
  Pause = 19
  CapsLock = 20
  Esc = 27
  Space = 32
  PGUP = 33
  PGDN = 34
  End = 35
  Home = 36
  Left = 37
  Up = 38
  Right = 39
  Down = 40
  PrintScreen = 44
  Insert = 45
  Delete = 46
 
  Num0 = 48
  Num1 = 49
  Num2 = 50
  Num3 = 51
  Num4 = 52
  Num5 = 53
  Num6 = 54
  Num7 = 55
  Num8 = 56
  Num9 = 57
 
  A = 65
  B = 66
  C = 67
  D = 68
  E = 69
  F = 70
  G = 71
  H = 72
  I = 73
  J = 74
  K = 75
  L = 76
  M = 77
  N = 78
  O = 79
  P = 80
  Q = 81
  R = 82
  S = 83
  T = 84
  U = 85
  V = 86
  W = 87
  X = 88
  Y = 89
  Z = 90
 
  Win = [91, 92]
  Apps = 93
 
  Pad0 = 96
  Pad1 = 97
  Pad2 = 98
  Pad3 = 99
  Pad4 = 100
  Pad5 = 101
  Pad6 = 102
  Pad7 = 103
  Pad8 = 104
  Pad9 = 105
  Multiply = 106
  Add = 107
  Subtract = 109
  Decimal = 110
  Divide = 111
 
  F1 = 112
  F2 = 113
  F3 = 114
  F4 = 115
  F5 = 116
  F6 = 117
  F7 = 118
  F8 = 119
  F9 = 120
  F10 = 121
  F11 = 122
  F12 = 123
 
  NumLock = 144
  ScrollLock = 145
 
  Collon = 186     # EN-US: ;:  PT-BR: çÇ
  Equal = 187      # EN-US: =+  PT-BR: =+
  Comma = 188      # EN-US: ,<  PT-BR: ,<
  Underscore = 189 # EN-US: -_  PT-BR: -_
  Dot = 190        # EN-US: .>  PT-BR: .>
  Backslash = 191  # EN-US: /?  PT-BR: ;:
  Accent = 192     # EN-US: '~  PT-BR: "'
  Query = 193      # EN-US:     PT-BR: /?
  Float = 194      # EN-US:     PT-BT: .
  LHook = 219      # EN-US: [{  PT-BR: ´`
  RBar = 220       # EN-US: |  PT-BR: ]}
  RHook = 221      # EN-US: ]}  PT-BR: [{
  Quote = 222      # EN-US: "'  PT-BR: ^~
  LBar   = 226     #            PT-BR: |
 
  Names = {1 => 'Mouse Left', 2 => 'Mouse Right', 3 => 'Cancel',
  4 => 'Mouse Middle', 5 => 'Mouse 4th', 6 => 'Mouse 5th', 8 => 'Backspace',
  9 => 'Tab', 12 => 'Clear', 13 => 'Enter', 16 => 'Shift', 17 => 'Control',
  18 => 'Alt', 19 => 'Pause', 20 => 'Caps Lock', 21 => 'Kana', 23 => 'Junja',
  24 => 'Final', 25 => 'Kanji', 27 => 'Escape', 28 => 'Convert', 29 => 'Non Convert',
  30 => 'Accept', 31 => 'Mode Change', 32 => 'Space', 33 => 'Page Up',
  34 => 'Page Down', 35 => 'End', 36 => 'Home', 37 => 'Left', 38 => 'Up',
  39 => 'Right', 40 => 'Down', 41 => 'Select', 42 => 'Print', 43 => 'Execute',
  44 => 'PrintScreen', 45 => 'Insert', 46 => 'Delete', 47 => 'Help',
  48 => '0', 49 => '1', 50 => '2', 51 => '3', 52 => '4', 53 => '5', 54 => '6',
  55 => '7', 56 => '8', 57 => '9', 65 => 'A', 66 => 'B', 67 => 'C', 68 => 'D',
  69 => 'E', 70 => 'F', 71 => 'G', 72 => 'H', 73 => 'I', 74 => 'J', 75 => 'K',
  76 => 'L', 77 => 'M', 78 => 'N', 79 => 'O', 80 => 'P', 81 => 'Q', 82 => 'R',
  83 => 'S', 84 => 'T', 85 => 'U', 86 => 'V', 87 => 'W', 88 => 'X', 89 => 'Y',
  90 => 'Z', 91 => 'Left Windows', 92 => 'Right Windows', 93 => 'Application',
  95 => 'Sleep', 96 => 'PAD 0', 97 => 'PAD 1', 98 => 'PAD 2', 99 => 'PAD 3',
  100 => 'PAD 4', 101 => 'PAD 5', 102 => 'PAD 6', 103 => 'PAD 7', 104 => 'PAD 8',
  105 => 'PAD 9', 106 => '*', 107 => '+', 108 => 'Separator', 109 => '-',
  110 => '.', 111 => '/', 112 => 'F1', 113 => 'F2', 114 => 'F3', 115 => 'F4',
  116 => 'F5', 117 => 'F6', 118 => 'F7', 119 => 'F8', 120 => 'F9', 121 => 'F10',
  122 => 'F11', 123 => 'F12', 124 => 'F13', 125 => 'F14', 126 => 'F15',
  127 => 'F16', 128 => 'F17', 129 => 'F18', 130 => 'F19', 131 => 'F20',
  132 => 'F21', 133 => 'F22', 134 => 'F23', 135 => 'F24', 144 => 'Number Lock',
  145 => 'Scroll Lock', 146 => 'OEM 15', 147 => 'OEM 16', 148 => 'OEM 17',
  149 => 'OEM 18', 150 => 'OEM 19', 160 => 'Left Shift', 161 => 'Right Shift',
  162 => 'Left Control', 163 => 'Right Control',   164 => 'Left Alt',
  165 => 'Right Alt', 166 => 'Browser Back', 167 => 'Browser Forward',
  168 => 'Browser Refresh', 169 => 'Browser Stop', 170 => 'Browser Search',
  171 => 'Browser Favorites', 172 => 'Browser Home', 173 => 'Volume Mute',
  174 => 'Volume Down', 175 => 'Volume Up', 176 => 'Media Next Track',
  177 => 'Media Previous Track', 178 => 'Media Stop', 179 => 'Media Play Pause',
  180 => 'Launch Mail', 181 => 'Launch Media Select', 182 => 'Launch Application',
  183 => 'Launch Application', 186 => 'OEM 1', 187 => 'OEM 2', 188 => 'OEM 3',
  189 => 'OEM 4', 190 => 'OEM 5', 191 => 'OEM 6', 192 => 'OEM 7', 219 => 'OEM 8',
  220 => 'OEM 9', 221 => 'OEM 10', 222 => 'OEM 11', 223 => 'OEM 13', 225 => 'OEM 20',
  226 => 'OEM 14', 227 => 'OEM 21', 228 => 'OEM 22', 229 => 'Proccess',
  230 => 'OEM 23', 232 => 'OEM 24', 240 => 'OEM 25', 241 => 'OEM 26',
  242 => 'OEM 27', 243 => 'OEM 28', 244 => 'OEM 29', 245 => 'OEM 30', 246 => 'ATTN',
  247 => 'CRSEL', 248 => 'EXSEL', 249 => 'EREOF', 250 => 'Play', 251 => 'Zoom',
  253 => 'PA1', 254 => 'OEM Clear'}
 
  Numbers = [48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
             96, 97, 98, 99, 100, 101, 102, 103, 104, 105]
 
  Values = {}
 
  Values["ALL"] = {32 => [" "], 49 => ["1", "!"], 50 => ["2", "@"],
  51 => ["3", "#"], 52 => ["4", "$"], 53 => ["5", "%"], 54 => ["6", "¨"],
  55 => ["7", "&"], 56 => ["8", "*"], 57 => ["9", "("], 48 => ["0", ")"],
  65 => ["a", "A"], 66 => ["b", "B"], 67 => ["c", "C"], 68 => ["d", "D"],
  69 => ["e", "E"], 70 => ["f", "F"], 71 => ["g", "G"], 72 => ["h", "H"],
  73 => ["i", "I"], 74 => ["j", "J"], 75 => ["k", "K"], 76 => ["l", "L"],
  77 => ["m", "M"], 78 => ["n", "N"], 79 => ["o", "O"], 80 => ["p", "P"],
  81 => ["q", "Q"], 82 => ["r", "R"], 83 => ["s", "S"], 84 => ["t", "T"],
  85 => ["u", "U"], 86 => ["v", "V"], 87 => ["w", "W"], 88 => ["x", "X"],
  89 => ["y", "Y"], 90 => ["z", "Z"], 96 => ["0"], 97 => ["1"], 98 => ["2"],
  99 => ["3"], 100 => ["4"], 101 => ["5"], 102 => ["6"], 103 => ["7"],
  104 => ["8"], 105 => ["9"], 106 => ["*"], 107 => ["+"], 109 => ["-"],
  110 => [","], 111 => ["/"]}
 
  Values["EN-US"] = {186 => [";", ":"], 187 => ["=", "+"], 188 => [",", "<"],
  189 => ["-", "_"], 190 => [".", ">"], 191 => ["/", "?"], 192 => ["'", "~"],
  219 => ["[", "{"], 220 => ["","|"], 221 => ["]", "}"], 222 => ['"', "'"]}
 
  Values["PT-BR"] = {186 => ["ç", "Ç"], 187 => ["=", "+"], 188 => [",", "<"],
  189 => ["-", "_"], 190 => [".", ">"], 191 => [";", ":"], 192 => ["'", '"'],
  193 => ["/", '?'], 194 =>["."], 219 => ["´", "`"], 220 => ["]", "}"],
  221 => ["[", "{"], 222 => ['~', "^"], 226 => ["","|"]}
 
  def self.name(id)
    return (Names.keys.include?(id) ? Names[id] : "???")
  end
 
  def self.value(id)
    if Values["ALL"].keys.include?(id)
      return Values["ALL"][id]
    elsif Values[Keyboard].keys.include?(id)
      return Values[Keyboard][id]
    else
      return Values["EN-US"][id]
    end
  end
 
end

#------------------------------------------------------------------------------
module Input
 
  @time = Array.new(256, 0)
  @press = Array.new(256, false)
  @trigger = Array.new(256, false)
  @repeat = Array.new(256, false)
  @release = Array.new(256, false)
  @dirs = [0, 0]
 
  InputInitialize = Win32API.new("Input", 'InputInitialize', 'LLLLLL', '')
  InputUpdate = Win32API.new("Input", 'InputUpdate', '', '')
 
  InputInitialize.call(@time.object_id, @press.object_id, @trigger.object_id,
  @repeat.object_id,  @release.object_id, @dirs.object_id)
 
  LEFT = 37
  UP = 38
  RIGHT = 39
  DOWN = 40
  A = [160, 161]
  B = [27, 88, 96]
  C = [13, 32, 90]
  X = 65
  Y = 83
  Z = 68
  L = 81
  R = 87
  SHIFT = 16
  CTRL = 17
  ALT = 18
  F5 = 116
  F6 = 117
  F7 = 118
  F8 = 119
  F9 = 120
 
  def self.update
    InputUpdate.call
  end
 
  def self.trigger?(id)
    @trigger.indexes(*id.to_a).include?(true)
  end
 
  def self.press?(id)
    @press.indexes(*id.to_a).include?(true)
  end
 
  def self.triggerd?(what)
    if triggered.include?(what)
      return true
    end
  end
 
  def self.triggered
    array = Array.new
    @trigger.each_index {|i| array.push(i) if @trigger[i]}
    array
  end
 
  def self.pressed?(what)
    if pressed.include?(what)
      return true
    end
  end
 
  def self.pressed
    array = Array.new
    @press.each_index {|i| array.push(i) if @press[i]}
    array
  end
 
  def self.repeat?(id)
    @repeat.indexes(*id.to_a).include?(true)
  end
 
  def self.repeated
    array = Array.new
    @repeat.each_index {|i| array.push(i) if @repeat[i]}
    array
  end
 
  def self.release?(id)
    @release.indexes(*id.to_a).include?(true)
  end
 
  def self.released
    array = Array.new
    @release.each_index {|i| array.push(i) if @release[i]}
    array
  end
 
  def self.dir4
    return 2 if self.pressed?(DOWN)
    return 4 if self.pressed?(LEFT)
    return 6 if self.pressed?(RIGHT)
    return 8 if self.pressed?(UP)
    return 0
  end
 
  def self.dir8
    if self.pressed?(UP)
      return 9 if self.pressed?(RIGHT)
      return 7 if self.pressed?(LEFT)
      return 8
    end
    if self.pressed?(DOWN)
      return 3 if self.pressed?(RIGHT)
      return 1 if self.pressed?(LEFT)
      return 2
    end
    return 6 if self.pressed?(RIGHT)
    return 4 if self.pressed?(LEFT)
    return 0
  end
 
end

#------------------------------------------------------------------------------
=begin
loop do
  Input.update
  for i in 0...256
    next unless Input.trigger?(i)
    p i
  end
end
=end

Who's 하늘바라KSND

profile

하늘바라KSND

하늘

하늘이

늘바

바라

하바

하바케이

하바케이엔

하느님 

------------------------------

현재 하는 일 :



허걱님과 함꼐하는 하늘섬 환상세계 시나리오 작성 중.

자세한 경과는 이야기 연재란에서.

 

Lighna형과 함께하는 프로젝트, D.A 시나리오 작성 중.

프로젝트 D.A 많은 관심 부탁드려요~

http://projetda.tistory.com/

-------------------------------

 

ㅎㅎ. 안녕하세요 하늘바라 KSND 입니다. 

(96년생)

성별 : 남

사용툴 : VX

주요 활동 : 소설쓰기, 댓글, 뻘글, 글소글

 

블로그 주소 : http://hb_tjdtn.blog.me/                 

 

이전 준비 중

http://habakn.tistory.com/         

 

 

Comment '3'
  • ?
    허걱 2011.09.04 21:16

    Input.trigger?(Keys::A) 등을 써주면 A가 눌렸을 경우를 나타내게 됩니다.

    trigger? 부분에는  trigger? press? repeat?  등을 써줄 수 있고

    각각 눌렸을 때 한번, 누르고 있을 때 계속, 누르고 있을 때 일정 간격마다 true(참일경우)를 돌려주게 됩니다.

    Keys::A 부분에 A대신 위에 적혀있는 키를 적으면 됩니다.

     

    예를들어조건분기에 Input.repeat?(Keys::R)  이라고 써주면 R을 누르고 있을 경우 일정 간격마다 참일경우가 실행되게 됩니다.

  • ?
    허걱 2011.09.04 21:17

    기존의 Input.trigger?(Input::A) 등으로 써줄경우 기존의 키가 적용되게 됩니다. (A일경우 SHIFT키)

  • profile
    하늘바라KSND 2011.09.04 21:18

    오호... 감사합니다. 허걱님~~


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12392
RMXP 전체키스크립트사용시... 1 슈프랭 2011.09.04 1992
RMVX SBABS9 내장 전체키 스크립트 이용하기 3 하늘바라KSND 2011.09.04 1492
RMXP 오토타일 리소스를 만들 때요 5 엘리언 2011.09.04 1858
RMVX '여긴 어디 그녀는 누구' 에서 말이죠. 1 Sword Legend 2011.09.04 2495
RMVX 아이템 획득후 못먹게 하기. 2 공팡내라면 2011.09.05 1604
RMVX 스크립트 질문 3 file Skeleton's bone 2011.09.05 1674
RMVX VX에서 플레이시간을 초기화 시키는 방법 없나요? 2 siraisi 2011.09.05 1474
RMVX 숫자 입력의 처리 두번째 할때 첫번째 한게 남아있는거 없애는법 1 라유 2011.09.06 1450
기타 그래픽 아무데서나 가져와도 되나요? 2 라유 2011.09.06 1196
RMXP 아오오니의 이벤트 1 RPG만들기? 2011.09.07 2121
RMXP 도박 이벤트 1 7번째루키 2011.09.07 1722
RMXP 듀토리얼만들때 3 슈프랭 2011.09.07 1812
RMXP TV오브젝트를 만드는데 모르겠어서 질문 드립니다 4 홍짱 2011.09.07 1526
RMVX vx를 쓰면서 궁금해했던 질문입니다. 3 가탁크 2011.09.08 1412
RMVX 만렙설정법좀요 2 dklqwer123 2011.09.08 1680
기타 이건 또 무슨 빛 이펙트 오류.. 2 은색바람 2011.09.09 1230
RMXP 보행그래픽에 관해 질문드립니다. 1 csw7201 2011.09.10 1379
RMVX 친구에게 게임 배포를 했는데요 4 이상한드링크 2011.09.10 1625
RMXP 캐릭터그래픽 만드는법 2 작은오타쿠 2011.09.10 1745
기타 뮤클라이언트 액알모션 설정방법 vx맨 2011.09.10 1375
Board Pagination Prev 1 ... 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ... 516 Next
/ 516