MatMoul / g810-led

Linux led controller for Logitech G213, G410, G413, G512, G513, G610, G810, g815, G910 and GPRO Keyboards
GNU General Public License v3.0
1.39k stars 184 forks source link

Handling command line inputs with ASCII values > 128 #26

Closed noisycat closed 7 years ago

noisycat commented 7 years ago

Need to decide on how we're going to do that if we want people to be able to use even the unsigned char set, like æ as @larsnaesbye pointed out. I don't have much experience with unsigned char (or unicode) on the command line as arguments for C programs, but being able to handle it at all is a prereq of handling local character sets.

larsnaesbye commented 7 years ago

I could live with using a standard moniker instead, like 'aelig'. Everything is better than having to remember it's the semicolon or whatever.

MatMoul commented 7 years ago

Just use a \ before the char... for tilde, you can use : g810-led -k \~ ff0000 always with tilde it's possible to add a second possibility as ex : g810-led -k tilde ff0000

noisycat commented 7 years ago

tilde? He's talking about ASCII+145, not ASCII+126 (reference: http://www.theasciicode.com.ar/extended-ascii-code/latin-diphthong-ae-lowercase-ascii-code-145.html )

+145 is outside of the (char* argv[]) input that main gets. And instead of just using complements, since most of those special characters aren't in the ASCII table, it starts making sense to have the discussion.

MatMoul commented 7 years ago

I have used the tilde sample to show that you can have multiple definition of a key I just tested to add æ in Keyboard::parseKey and it work from command line without \

MatMoul commented 7 years ago

Can I close this issue ?

larsnaesbye commented 7 years ago

Sure, if it works I see no reason not to close it :-)