Jump to content
Rpg²S Forum
  • 0

Uso dello script per l'input da tastiera


Broly88
 Share

Question

Scusate gente, vorrei chiedervi un piccolo favore. Sarei parecchio interessato all'uso di questo script per un mio mini progetto. Solo che il massimo che riesco a fare co 'sto script e copiarlo XD. Non è che qualche anima pia mi potrebbe spiegare come funge? La mia necessità sarebbe quella di creare una piccola finestra in cui l'utente può inserire del testo. Como se puede far? ...pure internazionale, valà ^__^... GRAZIE IN ANTICIPO!!!

Il mondo è il cancro... Io la cura...

 

Il mio sport preferito:

Gli altri --> (T_T#)O==(^_^Q) <-- IO

 

I miei alias:

http://www.naruto-kun.com/images/narutotest/shikamaru.jpg

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

http://www.naruto-kun.com/images/narutotest/rocklee.jpg

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

http://www.ff-fan.com/chartest/banners/auron.jpg

 

Broly88's

http://pokejungle.net/other/pokepet/trainers/e4k2.png http://pokejungle.net/other/pokepet/Charizard.gif

Flame Dancer the level 99 Charizard!

 

http://img259.imageshack.us/img259/7446/rockleeoj1.gif http://img233.imageshack.us/img233/7449/sorajm1.gif

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

la sintassi se non erro è:

if Kboard.keyboard($R_Key_***)

al posto di *** ci metti il nome del tasto che devi usare (comunque l'elenco sta all'inizio della classe kboard)

Progetti:

 http://i.imgur.com/jmLkIqi.png

http://i54.tinypic.com/2rh4ojq.png

https://github.com/ProGM

 

Crea anche tu il tuo gioco per Game Boy!
http://rpg2s.net/gif/SCContest3Oct.gifhttp://www.rpg2s.net/img/fablecontest1st.pnghttp://i43.tinypic.com/1zokd2s.png


http://i.imgur.com/BEu6G.gif

http://i.imgur.com/H1ARhq7.gif

http://i.imgur.com/Af6ijZN.gif

AOT: Associazione Odiamo la Telecom:

http://i.imgur.com/aYJs89E.png

"4 gattini... 4 stelline... E le 4 paperelle non ci stavano :3"

Flame


http://i30.tinypic.com/i27ypj.png

Link to comment
Share on other sites

  • 0
DEUS GRATIAS! Un comando chiaro! Ora provo anch'io.

http://img58.imageshack.us/img58/4264/newheavenhd2.jpg

 

Iscrivetevi alla nostra accademia di Rpgmaking, presto sarà piena di contenuti e lezioni su Mapping, Eventing, Pixel Art e Scrittura, a livelli bassi, medi e avanzati!

http://img185.imageshack.us/img185/4599/bannerua7.gif

Link to comment
Share on other sites

  • 0

ma non era deo gratias una volta xDD

 

comunque, ecco l'elenco dei tasti, per gli svogliati:

$RMouse_BUTTON_L  -> left mouse button
 $RMouse_BUTTON_R  ->  right mouse button
 $RMouse_BUTTON_M  ->  middle mouse button
 $RMouse_BUTTON_4  ->  4th mouse button # only tested with win2k with a logitech mouse (MX900)
 $RMouse_BUTTON_5  ->  5th mouse button # only tested with win2k with a logitech mouse (MX900)
 $R_Key_BACK  ->  BACKSPACE key
 $R_Key_TAB  ->  TAB key
 $R_Key_RETURN  ->  ENTER key
 $R_Key_SHIFT  ->  SHIFT key
 $R_Key_PAUSE  ->  PAUSE key
 $R_Key_CAPITAL  ->  CAPS LOCK key
 $R_Key_ESCAPE  ->  ESC key
 $R_Key_SPACE  ->  SPACEBAR
 $R_Key_PRIOR  ->  PAGE UP key
 $R_Key_NEXT  ->  PAGE DOWN key
 $R_Key_END  ->  END key
 $R_Key_HOME  ->  HOME key
 $R_Key_LEFT  ->  LEFT ARROW key
 $R_Key_UP  ->  UP ARROW key
 $R_Key_RIGHT  ->  RIGHT ARROW key
 $R_Key_DOWN  ->  DOWN ARROW key
 $R_Key_SELECT  ->  SELECT key
 $R_Key_PRINT  ->  PRINT key
 $R_Key_SNAPSHOT  ->  PRINT SCREEN key
 $R_Key_INSERT  ->  INS key
 $R_Key_DELETE  ->  DEL key
 $R_Key_0  ->  0 key
 $R_Key_1  ->  1 key
 ecc con i numeri
 $R_Key_A  ->  A key
 $R_Key_B  ->  B key
 $R_Key_C  ->  C key
e così via

 $R_Key_LWIN  ->  Left Windows key (Microsoft Natural keyboard) 
 $R_Key_RWIN  ->  Right Windows key (Natural keyboard)
 $R_Key_APPS  ->  Applications key (Natural keyboard)

 $R_Key_NUMPAD0  ->  Numeric keypad 0 key
 $R_Key_NUMPAD1  ->  Numeric keypad 1 key
 $R_Key_NUMPAD2  ->  Numeric keypad 2 key
ecc...
 $R_Key_MULTIPLY  ->  Multiply key (*)
 $R_Key_ADD  ->  Add key (+)
 $R_Key_SEPARATOR  ->  Separator key
 $R_Key_SUBTRACT  ->  Subtract key (-)
 $R_Key_DECIMAL  ->  Decimal key
 $R_Key_DIVIDE  ->  Divide key (/)

 $R_Key_F1  ->  F1 key
 $R_Key_F2  ->  F2 key
 $R_Key_F3  ->  F3 key
ecc
 $R_Key_NUMLOCK  ->  NUM LOCK key
 $R_Key_SCROLL  ->  SCROLL LOCK key

 $R_Key_LSHIFT  ->  Left SHIFT key
 $R_Key_RSHIFT  ->  Right SHIFT key
 $R_Key_LCONTROL  ->  Left CONTROL key
 $R_Key_RCONTROL  ->  Right CONTROL key
 $R_Key_L_ALT  ->  Left ALT key
 $R_Key_R_ALT  ->  Right ALT key
 
 $R_Key_SEP  ->  , key
 $R_Key_DASH  ->  - key
 $R_Key_DOTT  ->  . key

Progetti:

 http://i.imgur.com/jmLkIqi.png

http://i54.tinypic.com/2rh4ojq.png

https://github.com/ProGM

 

Crea anche tu il tuo gioco per Game Boy!
http://rpg2s.net/gif/SCContest3Oct.gifhttp://www.rpg2s.net/img/fablecontest1st.pnghttp://i43.tinypic.com/1zokd2s.png


http://i.imgur.com/BEu6G.gif

http://i.imgur.com/H1ARhq7.gif

http://i.imgur.com/Af6ijZN.gif

AOT: Associazione Odiamo la Telecom:

http://i.imgur.com/aYJs89E.png

"4 gattini... 4 stelline... E le 4 paperelle non ci stavano :3"

Flame


http://i30.tinypic.com/i27ypj.png

Link to comment
Share on other sites

  • 0
ODDIO. Il mio di script è completamente diverso. Stiamo parlando della stessa cosa? è sott'inteso che ti ringrazio ugualmente

Il mondo è il cancro... Io la cura...

 

Il mio sport preferito:

Gli altri --> (T_T#)O==(^_^Q) <-- IO

 

I miei alias:

http://www.naruto-kun.com/images/narutotest/shikamaru.jpg

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

http://www.naruto-kun.com/images/narutotest/rocklee.jpg

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

http://www.ff-fan.com/chartest/banners/auron.jpg

 

Broly88's

http://pokejungle.net/other/pokepet/trainers/e4k2.png http://pokejungle.net/other/pokepet/Charizard.gif

Flame Dancer the level 99 Charizard!

 

http://img259.imageshack.us/img259/7446/rockleeoj1.gif http://img233.imageshack.us/img233/7449/sorajm1.gif

Link to comment
Share on other sites

  • 0

allora non è quello di cybersam, il tuo O_o

 

posta, grazie xD

Progetti:

 http://i.imgur.com/jmLkIqi.png

http://i54.tinypic.com/2rh4ojq.png

https://github.com/ProGM

 

Crea anche tu il tuo gioco per Game Boy!
http://rpg2s.net/gif/SCContest3Oct.gifhttp://www.rpg2s.net/img/fablecontest1st.pnghttp://i43.tinypic.com/1zokd2s.png


http://i.imgur.com/BEu6G.gif

http://i.imgur.com/H1ARhq7.gif

http://i.imgur.com/Af6ijZN.gif

AOT: Associazione Odiamo la Telecom:

http://i.imgur.com/aYJs89E.png

"4 gattini... 4 stelline... E le 4 paperelle non ci stavano :3"

Flame


http://i30.tinypic.com/i27ypj.png

Link to comment
Share on other sites

  • 0

Scusa Pro Sai per caso come fare col module di Near Fantastica?

Eccutelo:

 

#==============================================================================
# ** Keyboard Input Module
#==============================================================================
# Near Fantastica
# Version 5
# 29.11.05
#==============================================================================
# The Keyboard Input Module is designed to function as the default Input module
# dose. It is better then other methods keyboard input because as a key is 
# tested it is not removed form the list. so you can test the same key multiple
# times the same loop.
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log("Keyboard Input", "Near Fantastica", 5, "29.11.05")

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state("Keyboard Input") == true
 
 module Keyboard
#--------------------------------------------------------------------------
@keys = []
@pressed = []
Mouse_Left = 1
Mouse_Right = 2
Back= 8
Tab = 9
Enter = 13
Shift = 16
Ctrl = 17
Alt = 18
Esc = 27
Space = 32
Numberkeys = {}
Numberkeys[0] = 48
Numberkeys[1] = 49
Numberkeys[2] = 50
Numberkeys[3] = 51
Numberkeys[4] = 52
Numberkeys[5] = 53
Numberkeys[6] = 54
Numberkeys[7] = 55
Numberkeys[8] = 56
Numberkeys[9] = 57
Numberpad = {}
Numberpad[0] = 45
Numberpad[1] = 35
Numberpad[2] = 40
Numberpad[3] = 34
Numberpad[4] = 37
Numberpad[5] = 12
Numberpad[6] = 39
Numberpad[7] = 36
Numberpad[8] = 38
Numberpad[9] = 33
Letters = {}
Letters["A"] = 65
Letters["B"] = 66
Letters["C"] = 67
Letters["D"] = 68
Letters["E"] = 69
Letters["F"] = 70
Letters["G"] = 71
Letters["H"] = 72
Letters["I"] = 73
Letters["J"] = 74
Letters["K"] = 75
Letters["L"] = 76
Letters["M"] = 77
Letters["N"] = 78
Letters["O"] = 79
Letters["P"] = 80
Letters["Q"] = 81
Letters["R"] = 82
Letters["S"] = 83
Letters["T"] = 84
Letters["U"] = 85
Letters["V"] = 86
Letters["W"] = 87
Letters["X"] = 88
Letters["Y"] = 89
Letters["Z"] = 90
Fkeys = {}
Fkeys[1] = 112
Fkeys[2] = 113
Fkeys[3] = 114
Fkeys[4] = 115
Fkeys[5] = 116
Fkeys[6] = 117
Fkeys[7] = 118
Fkeys[8] = 119
Fkeys[9] = 120
Fkeys[10] = 121
Fkeys[11] = 122
Fkeys[12] = 123
Collon = 186
Equal = 187
Comma = 188
Underscore = 189
Dot = 190
Backslash = 191
Lb = 219
Rb = 221
Quote = 222
State = Win32API.new("user32","GetKeyState",['i'],'i')
Key = Win32API.new("user32","GetAsyncKeyState",['i'],'i')
#--------------------------------------------------------------------------  
def Keyboard.getstate(key)
  return true unless State.call(key).between?(0, 1)
  return false
end
#--------------------------------------------------------------------------
def Keyboard.testkey(key)
  Key.call(key) & 0x01 == 1
end
#--------------------------------------------------------------------------
def Keyboard.update
  @keys = []
  @keys.push(Keyboard::Mouse_Left) if Keyboard.testkey(Keyboard::Mouse_Left)
  @keys.push(Keyboard::Mouse_Right) if Keyboard.testkey(Keyboard::Mouse_Right)
  @keys.push(Keyboard::Back) if Keyboard.testkey(Keyboard::Back)
  @keys.push(Keyboard::Tab) if Keyboard.testkey(Keyboard::Tab)
  @keys.push(Keyboard::Enter) if Keyboard.testkey(Keyboard::Enter)
  @keys.push(Keyboard::Shift) if Keyboard.testkey(Keyboard::Shift)
  @keys.push(Keyboard::Ctrl) if Keyboard.testkey(Keyboard::Ctrl)
  @keys.push(Keyboard::Alt) if Keyboard.testkey(Keyboard::Alt)
  @keys.push(Keyboard::Esc) if Keyboard.testkey(Keyboard::Esc)
  @keys.push(Keyboard::Space) if Keyboard.testkey(Keyboard::Space)
  for key in Keyboard::Numberkeys.values
	@keys.push(key) if Keyboard.testkey(key)
  end
  for key in Keyboard::Numberpad.values
	@keys.push(key) if Keyboard.testkey(key)
  end
  for key in Keyboard::Letters.values
	@keys.push(key) if Keyboard.testkey(key)
  end
  for key in Keyboard::Fkeys.values
	@keys.push(key) if Keyboard.testkey(key)
  end
  @keys.push(Keyboard::Collon) if Keyboard.testkey(Keyboard::Collon)
  @keys.push(Keyboard::Equal) if Keyboard.testkey(Keyboard::Equal)
  @keys.push(Keyboard::Comma) if Keyboard.testkey(Keyboard::Comma)
  @keys.push(Keyboard::Underscore) if Keyboard.testkey(Keyboard::Underscore)
  @keys.push(Keyboard::Dot) if Keyboard.testkey(Keyboard::Dot)
  @keys.push(Keyboard::Backslash) if Keyboard.testkey(Keyboard::Backslash)
  @keys.push(Keyboard::Lb) if Keyboard.testkey(Keyboard::Lb)
  @keys.push(Keyboard::Rb) if Keyboard.testkey(Keyboard::Rb)
  @keys.push(Keyboard::Quote) if Keyboard.testkey(Keyboard::Quote)
  @pressed = []
  @pressed.push(Keyboard::Mouse_Left) if Keyboard.getstate(Keyboard::Mouse_Left)
  @pressed.push(Keyboard::Mouse_Right) if Keyboard.getstate(Keyboard::Mouse_Right)
  @pressed.push(Keyboard::Back) if Keyboard.getstate(Keyboard::Back)
  @pressed.push(Keyboard::Tab) if Keyboard.getstate(Keyboard::Tab)
  @pressed.push(Keyboard::Enter) if Keyboard.getstate(Keyboard::Enter)
  @pressed.push(Keyboard::Shift) if Keyboard.getstate(Keyboard::Shift)
  @pressed.push(Keyboard::Ctrl) if Keyboard.getstate(Keyboard::Ctrl)
  @pressed.push(Keyboard::Alt) if Keyboard.getstate(Keyboard::Alt)
  @pressed.push(Keyboard::Esc) if Keyboard.getstate(Keyboard::Esc)
  @pressed.push(Keyboard::Space) if Keyboard.getstate(Keyboard::Space)
  for key in Keyboard::Numberkeys.values
	@pressed.push(key) if Keyboard.getstate(key)
  end
  for key in Keyboard::Numberpad.values
	@pressed.push(key) if Keyboard.getstate(key)
  end
  for key in Keyboard::Letters.values
	@pressed.push(key) if Keyboard.getstate(key)
  end
  for key in Keyboard::Fkeys.values
	@pressed.push(key) if Keyboard.getstate(key)
  end
  @pressed.push(Keyboard::Collon) if Keyboard.getstate(Keyboard::Collon)
  @pressed.push(Keyboard::Equal) if Keyboard.getstate(Keyboard::Equal)
  @pressed.push(Keyboard::Comma) if Keyboard.getstate(Keyboard::Comma)
  @pressed.push(Keyboard::Underscore) if Keyboard.getstate(Keyboard::Underscore)
  @pressed.push(Keyboard::Dot) if Keyboard.getstate(Keyboard::Dot)
  @pressed.push(Keyboard::Backslash) if Keyboard.getstate(Keyboard::Backslash)
  @pressed.push(Keyboard::Lb) if Keyboard.getstate(Keyboard::Lb)
  @pressed.push(Keyboard::Rb) if Keyboard.getstate(Keyboard::Rb)
  @pressed.push(Keyboard::Quote) if Keyboard.getstate(Keyboard::Quote)  
end
#--------------------------------------------------------------------------
def Keyboard.trigger?(key)
  return true if @keys.include?(key)
  return false
end
#--------------------------------------------------------------------------
def Keyboard.pressed?(key)
  return true if @pressed.include?(key)
  return false
end
 end

#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end

Edited by Mike Portnoy

http://img58.imageshack.us/img58/4264/newheavenhd2.jpg

 

Iscrivetevi alla nostra accademia di Rpgmaking, presto sarà piena di contenuti e lezioni su Mapping, Eventing, Pixel Art e Scrittura, a livelli bassi, medi e avanzati!

http://img185.imageshack.us/img185/4599/bannerua7.gif

Link to comment
Share on other sites

  • 0

se non erro bisogna aggiungere in Scene_Map, nella def update un

Keyboard.update

poi la sintassi è simile a Input

Kboard.trigger?(nome del tasto)

l'elenco dei tasti è quello che c'è all'inizio del modulo O_o

cioè ad esempio:

Kboard.trigger?(Kboard::Mouse_Left)

Progetti:

 http://i.imgur.com/jmLkIqi.png

http://i54.tinypic.com/2rh4ojq.png

https://github.com/ProGM

 

Crea anche tu il tuo gioco per Game Boy!
http://rpg2s.net/gif/SCContest3Oct.gifhttp://www.rpg2s.net/img/fablecontest1st.pnghttp://i43.tinypic.com/1zokd2s.png


http://i.imgur.com/BEu6G.gif

http://i.imgur.com/H1ARhq7.gif

http://i.imgur.com/Af6ijZN.gif

AOT: Associazione Odiamo la Telecom:

http://i.imgur.com/aYJs89E.png

"4 gattini... 4 stelline... E le 4 paperelle non ci stavano :3"

Flame


http://i30.tinypic.com/i27ypj.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...