Input.Pressed F1-12 and other...

Started by dame dema · 8 months ago · 6 replies · 379 views

#1
dame dema
Member
JoinedDec 2022 Posts4 Score165
Dear developers of game modes and S&Box developers, I have a question about input buttons. How can I create a bind/console command to execute F1-F12 key presses?

I know that the game engine doesn't allow me to simply bind these buttons. I tried doing it via a command, but it tells me I can't bind using a console command.

I tried something like (bind f4 menu), but it says "Can't run command bind".
#2
Titanovsky
Member
JoinedSep 2021 Posts326 Score3,973
Hello, it seems that this cannot be done at the moment. I tried 
if ( Input.Keyboard.Down( "F4" ) ) 
 and it didn't work, i tried what all good developers do using Input action, but that didn't work either. Of course, you can't call the "bind" command for the player, so yes, most likely there's no way. Anyway, F1-F2 cannot be rebinded. You can write an issue, or just call the menu in custom Escape or Tab
#3
matt
Facepunch
JoinedApr 2021 Posts266 Score2,045
This is on purpose, they're reserved for the engine. People did these menus on those keys in Gmod because there were no other options, now there are so many different buttons you can put menus on with proper bindings.
#4
dame dema
Member
JoinedDec 2022 Posts4 Score165
The funniest thing is that a player can bind an action (a command) to a key (even F1-12), and it will execute something, but it will be stored in a personal cfg file, as I understand. 🤔

I wanted to create my own cfg file for my gamemode that would work like an autoexec.cfg 
I tried various methods, but this doesn't work. 

So, I'm waiting for an answer from Garry or someone else on when we'll be able to bypass this key-blocking logic. I believe in the long run, this will help someone, maybe even me. (As a player, I like to use Left Alt to slow down my character, and it's simply unpleasant for me to press something else that's far from my finger.) 🤷‍♂️
#5
Braxen 🐟
Member
JoinedJun 2021 Posts189 Score190
so just use left alt as an action in game
#6
Titanovsky
Member
JoinedSep 2021 Posts326 Score3,973
You got an answer from matt F1-F12 won't be available for force binding when you create a game. Maybe you can change them in standalone development, but definitely not on the platform. Just use other keys. There is a stupid way, but it's better than nothing. Make ConCmd for a method and then hint players to bind this command to F4. 

imo, nothing terrible will happen if in the hundredth iteration of darkrp the menu opens on Tab or Q 
#7
dame dema
Member
JoinedDec 2022 Posts4 Score165
You keep shoving the same thing in my face. I already said, cool, yes, I can tell players to use a console command to bind keys. But I need players to have to do fewer actions. I absolutely hate having to press Q, TAB, Z, X, C, V, B, N, and so on.
It doesn't make a huge difference to me which mode these settings are for. I just want to disable the F1 menu and be able to bind keys to F1-F12, LEFT/RIGHT ALT, etc., without having to hint to players that they need to do anything.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.