Advertisement
mikb89

[Ace] ReMapped Keys v1.0

Oct 22nd, 2012
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.11 KB | None | 0 0
  1. # ReMapped Keys v. 1.0
  2. # VX Ace version
  3. # by mikb89
  4.  
  5. # Dettagli:
  6. #  Questo script permette di rimappare i tasti, utile se usate uno script per la
  7. #   tastiera estesa, come quello di Keroro. Metti caso che ad esempio volete far
  8. #   girare il vostro gioco su un cabinato, ecco, questo script sembra fatto
  9. #   apposta per voi! xD
  10.  
  11. # Configurazioni:
  12. module REMAP
  13.   ASSIGN = {
  14.       # Tasti direzionali (Frecce e PagSu/Giù):
  15.     #:DOWN =>,
  16.     #:LEFT =>,
  17.     #:RIGHT =>,
  18.     #:UP =>,
  19.     #:L =>,
  20.     #:R =>,
  21.       # Tasti di interazione:
  22.     :A => :NUM4, # Tasto SHIFT: quello per la corsa.
  23.     :B => :NUM3, # Tasto Esc: menu, annulla, indietro...
  24.     :C => :NUM2, # Tasto Invio: azione, seleziona, ok...
  25.       # Tasti aggiuntivi:
  26.     :X => :NUM5,
  27.     :Y => :NUM6,
  28.     :Z => :NUM7,
  29.   }
  30.   #Impostate qui su i vari tasti (dipende dallo script di tastiera estesa in uso)
  31. end
  32.  
  33. #Codename: remap
  34.  
  35. ($imported ||= {})[:mikb89_remap] = true
  36.  
  37. # License:
  38. # - You can ask me to include support for other scripts as long as these scripts
  39. #   use the $imported[script] = true;
  40. # - You can modify and even repost my scripts, after having received a response
  41. #   by me. For reposting it, anyway, you must have done heavy edit or porting,
  42. #   you can't do a post with the script as is;
  43. # - You can use my scripts for whatever you want, from free to open to
  44. #   commercial games. I'd appreciate by the way if you let me know about what
  45. #   you're doing;
  46. # - You must credit me, if you use this script or part of it.
  47.  
  48. class << Input
  49.   alias press_b4_remap press? unless method_defined?(:press_b4_remap)
  50.   alias trigg_b4_remap trigger? unless method_defined?(:trigg_b4_remap)
  51.   alias repeat_b4_remap repeat? unless method_defined?(:repeat_b4_remap)
  52. end
  53. module Input
  54.   module_function
  55.   def press?(key)
  56.     key = REMAP::ASSIGN[key] if REMAP::ASSIGN.include?(key)
  57.     press_b4_remap(key)
  58.   end
  59.   def trigger?(key)
  60.     key = REMAP::ASSIGN[key] if REMAP::ASSIGN.include?(key)
  61.     trigg_b4_remap(key)
  62.   end
  63.   def repeat?(key)
  64.     key = REMAP::ASSIGN[key] if REMAP::ASSIGN.include?(key)
  65.     repeat_b4_remap(key)
  66.   end
  67. en
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement