[REL] Headlight controls

Discussion in 'Other' started by Seven Smiles, Aug 20, 2019.

  1. Jamilton

    Jamilton Registered

    Joined:
    Jun 15, 2017
    Messages:
    14
    Likes Received:
    7
    Even running as administrator, the manual flash function did not work. Pitlane flashing still works fine. Should I try running the debug version?
     
  2. davehenrie

    davehenrie Registered

    Joined:
    Jul 6, 2016
    Messages:
    2,583
    Likes Received:
    1,514
    can you take a screenshot of the app running? So we can see how your buttons are configured.
     
  3. Jamilton

    Jamilton Registered

    Joined:
    Jun 15, 2017
    Messages:
    14
    Likes Received:
    7
    Images of the app when in the pitlane and on track are provided. H key for headlight toggle, Left Control for flash. I had also tried F and some other keys, as well as the * key on my USB keypad, but to no avail.
     

    Attached Files:

  4. davehenrie

    davehenrie Registered

    Joined:
    Jul 6, 2016
    Messages:
    2,583
    Likes Received:
    1,514
    The left ctrl option to flash your lights may be the problem. 'leftctrl' is used in conjunction with other commands. Try picking an unused single key or button on your controller.
     
  5. Jamilton

    Jamilton Registered

    Joined:
    Jun 15, 2017
    Messages:
    14
    Likes Received:
    7
    I just tried setting it to G there, still no effect.
     
  6. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    740
    Likes Received:
    799
    Note that I’m on holiday until next week and can’t investigate this problem.
     
    Jamilton likes this.
  7. Sanchit Rathi

    Sanchit Rathi Registered

    Joined:
    Jan 22, 2020
    Messages:
    36
    Likes Received:
    11
    Hello I hope you had a nice holiday, I too am having the same issue as Jamilton, the pit lane flash is working, but not the button. If you have time could you please look into it? Thank you very much for this mod
     
  8. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    740
    Likes Received:
    799
    Now that I look properly I think the problem is that @Jamilton has used the same control (Keyboard H) for the Player Toggle and the rFactor Toggle. They're two different things, when you press the Player Toggle control it operates the rFactor Toggle key to change the headlight state in game. If they're the same then my program will send its "fake" H just after rFactor sees the real H from the keyboard. The outcome is a probably undefined, I'll try it out tomorrow.

    Though Left Ctrl should still flash the headlights...
    :confused: I don't know how much testing I did with using the keyboard for Player Headlight Controls, I designed the program thinking of using controller buttons to operate the headlights.
     
    Last edited: Feb 21, 2020
    Sanchit Rathi likes this.
  9. Sanchit Rathi

    Sanchit Rathi Registered

    Joined:
    Jan 22, 2020
    Messages:
    36
    Likes Received:
    11
    Thank you for your swift reply, Attached are the settings being used for the app by me, I have used F key to toggle headlights instead of H in player control, however pressing F does not turn on the headlight, furthermore I tried using LCTRL and APOSTROPHE as my flash headlight key, it didnt work either. Not sure why this is happening. Only error I got since i have run the app was the controller.json file error. I fixed that in the ini by specifying the location for the controller.json. Your help will be greatly appreciated.
    headlight settings 1.png
     
  10. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    740
    Likes Received:
    799
    OK, I have an answer. You may not like it! Keyboard events are only occurring when Headlights has focus, if rFactor has focus (the game is running) only game controller buttons generate events. So Headlights works when I use it with Flash headlights mapped to a button on the £5 game controller I use as a "button box". Headlights shouldn't let you map a keyboard button as that doesn't work.

    I remember a similar problem in another of my programs which was caused by having the GUI to configure things running at the same time as the code which handles the running game so I may be able to fix it by splitting Headlights into two but there's only one way to find out and I won't promise when I might be motivated to try it.
     
    Jamilton likes this.
  11. Sanchit Rathi

    Sanchit Rathi Registered

    Joined:
    Jan 22, 2020
    Messages:
    36
    Likes Received:
    11
    Hi, thank you very much for the detailed reply, sorry for my delayed response but i do have a steering wheel so ill give it a shot on the buttons over there and get back to you.
     

Share This Page