질문과 답변

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 12441
RMXP RTAB 스크립트 충돌나네요;;; 도와주세요 ㅠㅠ 3 file 듀오 2011.01.18 767
스크립트 작성 RMXP RTAB 스킬 준비 애니메이션 file Ringccubus 2019.05.17 52
에러 해결 RM2k RTP 다운로더가 실행이 되지 않습니다 ikarisou 2020.07.30 123
RMVXA RTP를 깔아도 기본 소재를 불러올 수 없는 경우 4 여줄가리 2017.08.21 178
라이선스 기타 RTP를 편집해서 사용하는 경우 저작권은 어떻게 될까요? 2 모쟁 2013.11.13 1514
RMXP RTP에 대해 1 네메닷 2011.03.22 1401
RM2k3 RTP체크 하는 방법 9 엑스트라 2013.01.10 960
RMXP rtp파일 적용하는 법을 알고 싶습니다! 참고로 rmxp입니다 2 식물이심 2014.09.09 523
RMVXA Ruby스크립트.. 2 필드 2013.09.18 1114
RMVX rvdata 데이터 파일 읽는 법 아시나요?? 1 file sojena 2014.07.29 1525
RMVX RVDATA2 파일은 어떤 프로그램으로 열어야하나요? 2 글쓰니안쓰니 2013.03.28 10133
기타 rvdata2 확장자는 무슨 제작툴을 쓴건가요? 6 식인곰푸 2014.06.17 7781
RMVX rvdata2파일 질문입니다. 4 fhakd 2013.05.11 2283
맵배치 RMMV R타일? 은 어떻게 쓰는건가요? 2 file 구라수리 2019.03.22 1100
RMVX s [0041-0050] ~ v[0001] [0010] 같은창이 계속 뜹니다 2 Thyella 2015.01.25 177
스크립트 사용 RMVXA SAS IV HUD의 내용을 메뉴가 열려있는 동안 숨길 수 있게 하는 방법은 없을까요? file 아무개 2023.05.22 26
RMXP SBABS 파티원 멤버 삭제가 안되네요. (데모업로드) file 쿠쿠 2013.02.03 964
RMVX SBABS9 내장 전체키 스크립트 이용하기 3 하늘바라KSND 2011.09.04 1492
RMVX SBABS라는 액알 대문에 질문합니다. 4 SINCOON 2011.11.21 1745
RMVX sbabs스크립트에서 적 몬스터의 대각 이동을 가능토록 할 방법이 없을까요? 1 닉네임은2와20 2012.06.05 1306
Board Pagination Prev 1 ... 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 ... 516 Next
/ 516