r57zone / DualShock4-emulator

DualShock4 emulation for Xbox controllers or keyboard and mouse / Эмуляция DualShock4 для Xbox контроллеров или клавиатуры и мыши

Home Page:https://youtu.be/17hY1zTqoYQ

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] How do I comment out and uncomment text in the config file?

gaveitatry2 opened this issue · comments

I want to learn how to comment out 1.) lines of text, 2.) blocks of text, an 3.) parts of a line, but not just the end of the line.

1.) Lines of text.

Like this:

[DS4]
InvertX=0
InvertY=0

# This line is commented out.
// This line is commented out.
<!-- This line is commented out. -->

2.) Blocks of text.

Like this:

[DS4]
InvertX=0
InvertY=0

# This line (of a block) is commented out.
# This line (of a block) is commented out.
# This line (of a block) is commented out.

// This line (of a block) is commented out.
// This line (of a block) is commented out.
// This line (of a block) is commented out.

<!--
This line (of a block) is commented out.
This line (of a block) is commented out.
This line (of a block) is commented out.
-->

3.) Parts of a line (and not just at the end of the line).

Like this:

[DS4]
<!--This text is commented out.-->InvertX=0<!--This text is commented out.-->
<!--This text is commented out.-->InvertY=0<!--This text is aso commented out.-->

Would be great if it could ignore spaces too, like this:
<!--This text is commented out.--> InvertX=0          <!--This text is commented out.-->
<!--This text is commented out.--> InvertY=0          <!--This text is commented out.-->

Why do I want to do this?

I want to make the config files easier to read and for the config files to have all the information that I need so I don't have to refer to GitHub pages.

This is an explanation of my Last of Us controls (I will need to improve it later by using arrow characters for the dpad):

L1 -- LEFT_SHOULDER=2		RMB for "Zoom"
R1 -- RIGHT_SHOULDER=1		LMB for "Fire, Reload Weapon, Use Health"
L2 -- LEFT_TRIGGER=16		Shift for "Sprint"
R2 -- RIGHT_TRIGGER=17		Ctrl for "Listen Mode, Switch Shoulders While Aiming"
L3 -- LEFT_THUMB=70		F for "Focus On Hint/Scene"
R3 -- RIGHT_THUMB=18		Alt for "Flashlight"
O --- CIRCLE=67			C for "Crouch, Previous Menu"
X --- CROSS=32			Space for "Menu Select"
△ --- TRIANGLE=69		E for "Interact"
□ --- SQUARE=81			Q for "Melee, Escaping, Other"
----- SHARE=9			Tab for "Backpack/Crafting"
----- OPTIONS=79		O for "Options"
----- TOUCHPAD=13		Enter (not applicable)
----- DPAD_UP=38 		Up
----- DPAD_LEFT=37		Left
----- DPAD_RIGHT=39		Right
----- DPAD_DOWN=40		Down

1. ) Left side.

As you can see, the very left side had abbreviations of controls and symbols of controls, such as:
L1, R1, L2, R2, L3, R3, O, X, △, □ , and soon to be arrow characters for dpad.

It also has -----'s because when I use a monospace font in Notepad like consolas, it makes everything neatly aligned. I may end up switching to a different character instead of -----, though. I might use ______ instead.


2.) Right side.

And then on the very far right, I write what the key code stands for and what that button will do. For instance LEFT_SHOULDER=2...
2 is the key code for RMB, and for this game it is used for "Zoom".


3.) This is what I want to do on both the Left and Right sides.

So It would be nice if I could comment out stuff like this and have it ignore all the spaces:

<!--L1 __--> LEFT_SHOULDER=2		<!--RMB for "Zoom"-->
<!-______--> DPAD_DOWN=40		<!--Down-->

And this would not be as nice, because it doesn't have the aesthetically pleasing spaces:

<!--L1 __-->LEFT_SHOULDER=2<!--_____________RMB for "Zoom"-->
<!-______-->DPAD_DOWN=40<!--________________Down-->

4.) Bottom of config file.

And then I want to add a commented out block on the very bottom of the config file that has every key code, so a person can just look at their config file to know what the key codes are without having to refer to a website page.


5.) Side note.

I know that I could put the "explanation of controls" in a separate commented out block. But I wanted to make it even better than that. Because I think that it would be nice if the actual config part of the config file had L1, R1, L2, R2, L3, R3, O, X, △, □ , and soon to be arrow characters for dpad, to the left of the LEFT_SHOULDER=, RIGHT TRIGGER=, CROSS=, etc. to help better orientate users when they are trying to edit their bindings. When I am changing the config, it helps having those symbols L1, R1, L2, R2, L3, R3, O, X, △, □ immediately jump out of me. But also, sometimes when I am in-game, I forgot what I had assigned to L1, R1, L2, R2, L3, R3, O, X, △, □ and it helps to Alt + Tab to the config file and easily spot where that PS4 button is and what keyboard or mouse button I have assigned to it.


6.) Conclusion.

I hope that all the things that I want to do are already possible. And if not, I hope that DS4Emulator can be tweaked to make them possible. Thank you for taking the time to read this.

Hi, currently, comments can add above the lines. In the future, I will probably add a visual editor (with gamepad picture) of settings so that can see and quickly change. The designation is really wrong, I used them from the Xbox, will need to be replaced too. I'll see what else I can do with the comments.

# L1 -- RMB for "Zoom"
LEFT_SHOULDER=2

Okay, thank you for the information!

Renamed the names of the buttons and added comments, I hope now it will be more convenient and familiar https://github.com/r57zone/DualShock4-emulator/releases

Thank you.

I like the new program icon. It is very nice. I like it better than mine.

I see that you made it so we can customize the key for the exit button. That's nice. Thank you.

I didn't see any other changes, except a few # commented areas. I think that can be helpful, but I already added comments to my config files using the information that you provided.

If you look at Issue 11, you can see two things. 1.) For each game, I have # comments for each key. 2.) But not only that, if you scroll down to the very bottom of my Issue 11 thread, you will see a complete list of all the button key codes. I made that huge commented out section as a reference guide so I don't have to look on GitHub each time that I want to know the code number for a particular key.

I am not sure why you think the API is not yet completed for touchpad swipes. reWASD already uses the ViGEmBus touchpad swipes. The ViGEmBus developer said that ViGEmBus 1.17 already supports touchpad swipes. But I don't know. I'm not a developer, so maybe you are right. Anyway, my PlayStation Now subscription expires soon. I probably won't renew it for another 1-2 months. I will just be using your program for five more days to play 'The Darkness' and maybe 'Little Nightmares' and then I won't be able to play anymore. I will use version 1.5 for now, and I will update at a later time.

Thank you for continuously working on improving your program. It is definitely the best DS4 emulator program in existence! Hopefully you will have a look at Issue 11 to see some of my ideas. Thank you. God Bless!

Oh, I see you already updated Issue 11 to make it compatible with 1.15.1. Thank you. That's very helpful.