Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add text scrolling and font changing #4

Open
pascaltuf opened this issue Aug 29, 2024 · 9 comments
Open

Add text scrolling and font changing #4

pascaltuf opened this issue Aug 29, 2024 · 9 comments
Labels
enhancement New feature or request

Comments

@pascaltuf
Copy link

Hi, thanks again for what you created, thanks to you I created some scripts that allow me to view the time and music playing on Spotify on the GameDac.
I created my own repository with these scripts if you want to take a look to test them I would be happy.
On the script I made sure that if the text is too long it divides it into parts, so as to bypass the text scrolling (in case it is difficult for you to add it)
I also tried to add the hardware code of the keyboard so as to add more supported devices to this program also changing the resolution but I did not succeed, do you have any idea why? (I'm talking about Apex Pro)
As for the new features I saw the TODO you added and I would like you to add the ability to change the text font and the text scrolling.

@pascaltuf
Copy link
Author

pascaltuf commented Aug 29, 2024

I forgot a problem that I don't know if you are aware of regarding the display, the display can support a maximum of 18 characters but for some reason from the second line onwards it is moved by one character by removing the eighteenth character as you see in the photo (look at the last character the "R") and therefore it is not aligned, do you know why?
I tested it by running this command :
ggoled text "ABCDEFGHIJKLMNOPQRS n ABCDEFGHIJKLMNOPQRS n ABCDEFGHIJKLMNOPQRS `n ABCDEFGHIJKLMNOPQRS"

1

Or this :
ggoled text "|||||||||||||||||||||||||||||||||||| n |||||||||||||||||||||||||||||||||||| n |||||||||||||||||||||||||||||||||||| `n ||||||||||||||||||||||||||||||||||||"

2

Also if you run that command again but with a different text the text is written from above the other text, the only way is to do a "clear" and then it works as expected.

3

Instead if I add the commands to center the text (ggoled text "TEST HELLO" -C -x c -y c -a c) everything works fine, deleting everything from the display and putting the new text

@JerwuQu
Copy link
Owner

JerwuQu commented Sep 2, 2024

Nice repository and thank you for the bug report!

I will look into it when I have time (hopefully later this week) 😃

@JerwuQu
Copy link
Owner

JerwuQu commented Sep 11, 2024

Hello again!
I looked into the issue but could not reproduce it exactly. It looks like you may have put spaces at the beginning of the new lines which would put a space in front of the text (and moving it).

Compare

ggoled text "ABCDEFGHIJKLMNOPQRS `n ABCDEFGHIJKLMNOPQRS `n ABCDEFGHIJKLMNOPQRS `n ABCDEFGHIJKLMNOPQRS"

and

ggoled text "ABCDEFGHIJKLMNOPQRS`nABCDEFGHIJKLMNOPQRS`nABCDEFGHIJKLMNOPQRS`nABCDEFGHIJKLMNOPQRS"

Try again without spaces and see if that solves it for you.

@JerwuQu JerwuQu added the enhancement New feature or request label Sep 14, 2024
@JerwuQu
Copy link
Owner

JerwuQu commented Sep 14, 2024

As for the other things, you mentioned Apex Pro and more text options.

I suspect the keyboard uses the protocol differently and I would not be able to implement it myself without actually having the keyboard.

For text options, I'm fully up for implementing them but I would need to figure out how make the interface good. It might make sense to have scroll options for images too, for example. Should text be scrolling all the time, or only if it covers more than the screen? Should it scroll back and forth, or scroll of screen and appear at the other side, or some other variant? I don't personally require these text options right now so if you could assist with these decisions that would be great :)

@JerwuQu JerwuQu added the help wanted Extra attention is needed label Sep 14, 2024
@JerwuQu JerwuQu changed the title Add features Add text scrolling and font changing Sep 16, 2024
@pascaltuf
Copy link
Author

pascaltuf commented Sep 21, 2024

Hi, sorry I didn't answer you.
As for the space problem, you're right, I added an unnecessary space that caused me that problem, thanks for pointing it out.

For text scrolling, it would be better if:
By default, the program only activates scrolling if it exceeds the display characters (18 characters), but if you want, you could do it in such a way that, as you did to center the text where you put the options, you could force scrolling even to less than 18 characters at the user's discretion.
As for text scrolling, it would be nice if it scrolls like the video (it's the gamesense-essentials program that I showed you in the past, from which I took inspiration to make the script to show the song title) and to distinguish the beginning and the end of a text, you could put a separator like the one used in the video: " | "
The separator will be added automatically to the text line only if scrolling is activated

Text.scrolling.1.mp4

As for my scripts, have you had a chance to test them?
Do they work well or are there problems?
If you have tested it, can you tell me with which program (Spotify?)
Thanks in advance if you give me some Feedback 😊

@JerwuQu
Copy link
Owner

JerwuQu commented Sep 24, 2024

Hello again!

No problem, and thanks for the example.

I'll try out your scripts later, and give text scrolling a try after I've figured out how it should be implemented.

I'd be interested to know more about gamesense-essentials and if there are things ggoled could do to become better :)

@pascaltuf
Copy link
Author

gamesense-essentials is program created by mtricht, that works for all steelseries devices that have a screen, you can find it on github :
https://github.com/mtricht/gamesense-essentials

@JerwuQu JerwuQu removed the help wanted Extra attention is needed label Sep 28, 2024
@JerwuQu
Copy link
Owner

JerwuQu commented Sep 28, 2024

Tried your scripts and they work for me with Spotify :)

Will keep the scripts in mind when implementing text scrolling and such. It will be a big refactor since it will require ggoled to be able to run in the background to animate the display, but I'm working on it!

@JerwuQu
Copy link
Owner

JerwuQu commented Oct 5, 2024

Hello

Very basic scrolling has been added. This uses the --scroll flag (like --scroll slow). This required changing how the command works a bit since it needs to stay running to be able to scroll. I also went ahead and changed the defaults for position, alignment, and clearing. You will need to update your scripts.

As example, here's your Time.ps1 script running in stdin mode (meaning it only starts ggoled once!):

& {
    while ($true) {
        $currentTime = (Get-Date -Format "HH:mm:ss")
        "Time : $currentTime
@"
        Start-Sleep -Seconds 1
    }
} | ggoled text -d "@"

This unfortunately requires PowerShell 7 because PowerShell 5 is bugged with pipes.

You can still run it like you did before by just calling ggoled text "Some text", but it's more difficult to use for scripts if you want scrolling compared to using the stdin mode.

I will likely improve on the text features in the future but this should be an improvement for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants