Buttons and switches

Discussion in 'Technical & Support' started by J0E, Sep 25, 2020.

  1. J0E

    J0E Registered

    Joined:
    Sep 26, 2019
    Messages:
    156
    Likes Received:
    61
    I have two button questions.

    First, is there a way to get RF2 to recognize joystick buttons above #22? I have gone from a G27 (which is for sale) to a Fanatec with the universal hub (so I can build my own rims). It will recognize up to button 22, but not anything higher. Could additional buttons be added to the controller.json or the json for the Fanatec; I can't find documentation on the entries in the controller json files?

    Second button question involves rotary encoders/switches. Has anyone done the work to have a rotary switch work in RF2? I've built my own button boxes with Teensy so I'm sure it's doable but I don't want to reinvent something that already exists.

    Yes, I know that I could remap buttons and rotaries using joy2key or VoiceAttack (although VA crashes when run alongside CrewChief4...it doesn't seem to like the shared dll plugin).
     
  2. juanchioooo

    juanchioooo Registered

    Joined:
    May 16, 2016
    Messages:
    2,242
    Likes Received:
    1,649
    with arduino promicro you can put up to 32 buttons, using the pulsations for the encoders, converting them into 4 rotary encoders 45211.jpg pulsador.jpg ho814dm.jpg
     
  3. juanchioooo

    juanchioooo Registered

    Joined:
    May 16, 2016
    Messages:
    2,242
    Likes Received:
    1,649
    Evidently works in rfactor 2, ACC, AUTOMOBILISTA 2, ASSETTO CORSA
     
  4. juanchioooo

    juanchioooo Registered

    Joined:
    May 16, 2016
    Messages:
    2,242
    Likes Received:
    1,649
    I regret to have to paint the tapes of the encoders again... all work perfectly;):)

    120092081_3467054593314790_5157279077704881263_o.jpg
     
    DJCruicky likes this.
  5. davehenrie

    davehenrie Registered

    Joined:
    Jul 6, 2016
    Messages:
    7,571
    Likes Received:
    4,461
    I don't know who I envy more, guys who can patch 1000 triangles together to make a car, painters who can re-create in minute detail real world liveries, you DIYers who can source, wire and construct such devices......:D
     
    Emery and juanchioooo like this.
  6. J0E

    J0E Registered

    Joined:
    Sep 26, 2019
    Messages:
    156
    Likes Received:
    61
    I built a button plate for my G27 and used a Teensy. That mapped the buttons to keystrokes. I wasn't clear enough. The Fanatec has joystick buttons and if you try to assign J1B26 (the "B" button for an Xbox controller) button to an RF2 function, RF2 doesn't recognize the button press. That's why I said using joy2key or voiceattack would work because those recognize that button and could remap it to any keyboard key. I'd like to see if RF2 can recognize the joystick buttons natively.
    So the encoder circuity merely translates a rotary position to a keystroke? So you could map position one as "a," two as "b," etc.?
     
  7. lagg

    lagg Registered

    Joined:
    Oct 1, 2012
    Messages:
    3,043
    Likes Received:
    1,959
    AFAIK, no
     
    juanchioooo likes this.
  8. juanchioooo

    juanchioooo Registered

    Joined:
    May 16, 2016
    Messages:
    2,242
    Likes Received:
    1,649
    Sorry, I didn't understand the language well, I don't have fanatec, I don't know if a fanatec jostick detects it the same as a normal jostick, I think a normal jostick does detect it but I'm not 100% sure, I'm sorry:(:(:confused:
     
  9. J0E

    J0E Registered

    Joined:
    Sep 26, 2019
    Messages:
    156
    Likes Received:
    61
    Actually, your diagram gave me a lot of information. Thank you.
     
    juanchioooo likes this.
  10. juanchioooo

    juanchioooo Registered

    Joined:
    May 16, 2016
    Messages:
    2,242
    Likes Received:
    1,649
    In the diagram of the youtube video, it also tells you how to connect the pushbuttons of the encoders in arduino pro micro:);)
     
  11. juanchioooo

    juanchioooo Registered

    Joined:
    May 16, 2016
    Messages:
    2,242
    Likes Received:
    1,649
    15 -14 / 15 - 16 / 15 -10 / 15 - 9
    encoders.jpg potenciometros.jpg ho814dm.jpg
     
  12. JimmyT

    JimmyT Registered

    Joined:
    Jan 16, 2012
    Messages:
    924
    Likes Received:
    578
    I use Fanatec and two home built button boxes utilising the DSD (Derek Speare Design http://derekspearedesigns.com/32-button-no-matrix-controller.html) 32 button controller so 64 buttons / rotary encoders / multi position switches plus the Fanatec 22 buttons (see pic). I also use joy2key which allows me to use some of the joystick (fanatec and dsd) buttons as key strokes.
     

    Attached Files:

  13. J0E

    J0E Registered

    Joined:
    Sep 26, 2019
    Messages:
    156
    Likes Received:
    61
    I'm in VR so button boxes don't work at all. For my G27, I built a button plate on the wheel (based on an Arduino Teensy) but even that was hard to feel for buttons and often I thought I was on brake bias when I was actually pressing pit limiter.

    JimmyT, tell me how the rotary encoders work in RF2. Can you match the dial with in-game setup? For example, let's say I'm driving the F# Gen 2 and their are juice settings for 140, 150, 160, 170, 180, 190, 200, 210, 220. Can you match a switch position with each of those? Do you have to run some sort of setup routine each time to match the settings on the dials with the in-game settings?
     
  14. JimmyT

    JimmyT Registered

    Joined:
    Jan 16, 2012
    Messages:
    924
    Likes Received:
    578
    I use VR as well but have learned the button locations for my more regular use keys.
    Rotary encoder won't match the screen because each "click" is a button action. The only way you can have the position on your button match the game is to have each stop (140,150,160 etc) have a different button in rF2. rF2 doesn't do this so it won't work.
    When you look at the picture I posted, the top right hand of the right side box is a 10 position rotary SWITCH (not an encoder) and I use this for the display (in my hud) so pos 1 is vehicle status, pos 2 is Extra Info, pos 3 pit menu and so on. This works because rF2 has a different key for each of these. I hope that makes sense.
    Those options all work really well on the DSD button board.
    Pic of rotary switch

    s-l300.jpg
     
    juanchioooo and Lazza like this.
  15. J0E

    J0E Registered

    Joined:
    Sep 26, 2019
    Messages:
    156
    Likes Received:
    61
    I understand what you're saying, JimmyT. I have two rotary switches (not encoders) that I bought for something a while back and never got around to using. I forgot that there is a separate button for each page of the MFD. All of this is great information. I think I need to spend some more time staring up at the ceiling late at night thinking about this....
     
    juanchioooo likes this.
  16. JimmyT

    JimmyT Registered

    Joined:
    Jan 16, 2012
    Messages:
    924
    Likes Received:
    578
    I hear you, I spent 8 years saving the money, dreaming, planning, proto typing and building, only to get it all working then get VR :rolleyes: :D now I can't see the buttons OR the really expensive $$$ tacho you may see in the picture ( https://forum.studio-397.com/index.php?threads/buttons-and-switches.67305/#post-1040677 ). :eek:
     
    juanchioooo likes this.
  17. juanchioooo

    juanchioooo Registered

    Joined:
    May 16, 2016
    Messages:
    2,242
    Likes Received:
    1,649
    I prefer encoders to a switch, but in reality they are like a button, even if the assignments are too good idea too:)
     
  18. smbrm

    smbrm Registered

    Joined:
    Nov 11, 2010
    Messages:
    440
    Likes Received:
    50
    Hello, I have read your post about the AMStudio button box tutorial. I am wondering if you can assist with a question. In the video, the upper left red, covered switch is a simple off-on latching switch, which I assume is assigned to the “ignition” function. As rFactor 2 function all appear to use momentary buttons or switches, any idea on how is a latching switch incorporated in rFactor 2?
     
  19. juanchioooo

    juanchioooo Registered

    Joined:
    May 16, 2016
    Messages:
    2,242
    Likes Received:
    1,649
    it's a normal switch, it just depends on the switch you buy
    on my steering wheel I use one without insurance but it's the same
    https://twitter.com/i/status/1592992153613238272
     
  20. juanchioooo

    juanchioooo Registered

    Joined:
    May 16, 2016
    Messages:
    2,242
    Likes Received:
    1,649

Share This Page