generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Simulating Keyboard Inputs Using a Function?

Previous Thread :: Next Thread 
Poloboy567 is not online. Poloboy567
Joined: 24 Jun 2008
Total Posts: 62
03 Apr 2015 09:44 PM
Is it possible to create a function that can fire a line of code that would simulate a key-press on the keyboard? I'm optimising my game for Xbox controller support and I want to make it possible for players to cycle through numbers 0-9 using the left and right d-pad, then press Y to fire the selected number as a keyboard input to be able to select different items in their inventory. I've searched the wiki and can't seem to stumble across anything that relates to simulating a key-press with a function.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
03 Apr 2015 09:50 PM
The best way is to make your own inventory and control system. You can't simulate a keypress in Roblox.
Report Abuse
Link5659 is not online. Link5659
Joined: 04 Jun 2012
Total Posts: 4525
30 Nov 2015 09:29 PM
bumping this thread back to life, because im trying to make a button for ios that on touch will emulate the user pressing the "r" key. I couldn't find any other posts on this or anything about this on the wiki so if anyone has a script or a wiki links about this it would help alot!
Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
30 Nov 2015 09:31 PM
I don't think it's possible to emulate input in the game. Sorry :(
Report Abuse
TickerOfTime is not online. TickerOfTime
Joined: 02 Sep 2012
Total Posts: 2030
30 Nov 2015 10:10 PM
You actually can emulate input and other events, but its completely restricted rn
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
30 Nov 2015 10:13 PM
The easiest way to do this is writing your code to run external handler calls (functions run without triggering the event they're connected to). For example:


function Touched(hit)
print(hit.Name)
end
script.Parent.Touched:connect(Touched)

Touched(workspace)
--> Workspace


In this case, the Touched function is called separately from the event, and the code to handle said event runs anyway because we forcefully called the function.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image