Go to advanced search

by davenull
Sun Apr 03, 2016 6:12 pm
Forum: C/C++
Topic: read keyboard keypress: function keys
Replies: 78
Views: 14713

Re: read keyboard keypress: function keys

hell, 3 (THREE) characters....???? so how do I have to detect a Fx keypress? i=getchar(); if(i==27) { i=getchar(); if i== 79.. if i==80....???? if i==81...???? else if.....? else if.....? else if.....? else if.....? and then to distinguish from a plain ESC keypress? and then how to check for 5*102 d...
by davenull
Sun Apr 03, 2016 6:02 pm
Forum: C/C++
Topic: read keyboard keypress: function keys
Replies: 78
Views: 14713

Re: read keyboard keypress: function keys

I still don't understand.
F1 is now what? 27+79? or 27+80 ?

and I use no terminal, I just read getchar from my C program!
by davenull
Sun Apr 03, 2016 5:52 pm
Forum: C/C++
Topic: read keyboard keypress: function keys
Replies: 78
Views: 14713

Re: read keyboard keypress: function keys

for the first start, I just need to detect F1...F12 then, perhaps, shift+F1... shift+F12 then, perhaps, cur left, right, up, dn, home, end, pgUp, PgDn, ins, del rest we'll see. I use no special terminal. I use just getchar() from stdio.h A overall-overview in a chart table would be appreciated - tha...
by davenull
Sun Apr 03, 2016 5:37 pm
Forum: C/C++
Topic: read keyboard keypress: function keys
Replies: 78
Views: 14713

Re: read keyboard keypress: function keys

of course I have already googled, but could not find any table for function keys and other special keys and their code values read by getchar() in decimal numbers. the showkey program is not suitable, it's confusing me, f 102 0146 0x66 r 114 0162 0x72 ^[OP 27 0033 0x1b 79 0117 0x4f 80 0120 0x50 I ne...
by davenull
Sun Apr 03, 2016 5:28 pm
Forum: C/C++
Topic: read keyboard keypress: function keys
Replies: 78
Views: 14713

Re: read keyboard keypress: function keys

maybe, but for me it's too weird.
decimal numbers, such as ASCII codes in a ASCII table, are needed.
by davenull
Sun Apr 03, 2016 5:08 pm
Forum: C/C++
Topic: read keyboard keypress: function keys
Replies: 78
Views: 14713

Re: read keyboard keypress: function keys

thank you, but as I already mentioned above, I can't handle Home ^[[1~ Insert ^[[2~ Delete ^[[3~ End ^[[4~ Pgup ^[[5~ PgDn ^[[6~ I can just handle things like (fictive): key plain shift ctrl alt shift+ctrl ctrl+alt shift+alt shift+ctrl+alt Home 27+ 12 Insert 27+ 45 Delete 27+ 120 End 27+ 88 Pgup 27+...
by davenull
Sun Apr 03, 2016 4:35 pm
Forum: C/C++
Topic: read keyboard keypress: function keys
Replies: 78
Views: 14713

Re: read keyboard keypress: function keys

my terminal is just the one which throws my C program to my Raspi desktop when I program printf(); and then , eventually, c=getchar(); Unfortuntlely I have no idea what GTK/Qt or xinput or Xserver or ioctl is, I'm just using simple stdio.h commands, and I was hoping to have a simple enhancement for ...
by davenull
Sun Apr 03, 2016 3:35 pm
Forum: C/C++
Topic: read keyboard keypress: function keys
Replies: 78
Views: 14713

Re: read keyboard keypress: function keys

is there a tutorial for newbies to that ?
and also a list of all 2nd-key readings after the initial 27 for all special keys ?
this list already would be actually a good start!

I mean, after 40 years of Linux (Unix) I wouldn't have to invent all the wheels anew ( I hope... )
by davenull
Sun Apr 03, 2016 2:43 pm
Forum: C/C++
Topic: read keyboard keypress: function keys
Replies: 78
Views: 14713

Re: read keyboard keypress: function keys

hm, well , I actually didn't see through that so far. I supposed the keyboard hardware itself to send the keycodes as integers just in time the key is pressed, and then repetitively again while it's still pressed, and it was not clear to me that all I may get is something what a terminal emulator al...
by davenull
Sun Apr 03, 2016 11:53 am
Forum: C/C++
Topic: read keyboard keypress: function keys
Replies: 78
Views: 14713

Re: read keyboard keypress: function keys

I mean, how to poll these scancodes like listed here, but just by 1 single reading:

http://flint.cs.yale.edu/cs422/doc/art- ... APNDXC.PDF
(Appendices Page 1353)
by davenull
Sun Apr 03, 2016 11:41 am
Forum: C/C++
Topic: read keyboard keypress: function keys
Replies: 78
Views: 14713

Re: read keyboard keypress: function keys

yes, that will be a workaround, and that was what I meant by I don't read ^[, I need to have the native ASCII values (0...127) at least, then for the 2nd reading (i.e., after the initial 27) neverthelsess, I would prefer to have unique functionkey scancodes (int32 or int64, e.g., 64531 for F1, 64532...
by davenull
Sun Apr 03, 2016 10:54 am
Forum: C/C++
Topic: read keyboard keypress: function keys
Replies: 78
Views: 14713

Re: read keyboard keypress: function keys

hmmm... I don't read ^[, I need to have the native ASCII values (0...127) at least, then for the 2nd reading

but I'm afraid, interferences with the ESC key == 27 will make it shaky anyway...
by davenull
Sun Apr 03, 2016 8:34 am
Forum: C/C++
Topic: read keyboard keypress: function keys
Replies: 78
Views: 14713

Re: read keyboard keypress: function keys

I see, thank you! the kbhit function once was posted by you so I thankfully could use it - but I don't quite (totally) understand what it does in detail. the 2nd advice instead looks more easy to understand, if at a functionkey press the kbhit() is still true after the inital ECS reading and then ju...
by davenull
Sun Apr 03, 2016 7:27 am
Forum: C/C++
Topic: read keyboard keypress: function keys
Replies: 78
Views: 14713

Re: read keyboard keypress: function keys

thank you, Paeryn! there is a console window which is opened additionally to the openVG window, and the key presses are recognized from that (stdio.h). OTOH, getting an ESC as a first char is not good at all...: pressing the ESC key, that would be terminating the program immediately, totally: void* ...
by davenull
Sun Apr 03, 2016 7:19 am
Forum: C/C++
Topic: safety shutdown for motor controlling pins
Replies: 4
Views: 620

Re: safety shutdown for motor controlling pins

There is no risk to the Pi. ok, thank you, that is reassuring. OTOH, IIUC, it also means: if the faulty task (which is perhaps hung up by mistake and does not release control of the pin), e.g. is stuck in an endless loop while(1) {digitalWrite( 15, HIGH); } there would be no chance for the emergenc...
by davenull
Sat Apr 02, 2016 10:47 pm
Forum: C/C++
Topic: safety shutdown for motor controlling pins
Replies: 4
Views: 620

Re: safety shutdown for motor controlling pins

can it damage the Pi if 1 thread pulls a certain GPIO pin high and another concurrent one pulls it low?
Do I risk a short cut then?
if not, what will happen, what will be the pin state at the end?
I don't want just to try, because I'm afraid of perhaps destroying my Pi.
by davenull
Sat Apr 02, 2016 9:25 pm
Forum: Raspberry Pi OS
Topic: how to start with keyb NUMLOCK automatically?
Replies: 7
Views: 1993

Re: how to start with keyb NUMLOCK automatically?

YES!
Image

AND EASY AS EVER ON THE RASPI ! :lol:

THANKS A LOT! 8-) 8-) 8-)
by davenull
Sat Apr 02, 2016 7:57 pm
Forum: C/C++
Topic: C++ experiences with the Pixy Cam?
Replies: 17
Views: 3029

C++ experiences with the Pixy Cam?

hey,
is anyone experienced in programming the Pixy Cam with gpp C/C++ (possibly in Geany IDE)?
which interface ist most easy to use?
SPI, UART, or I2C? (the standard 6-pin header cable just supports SPI, at least for Arduinos, IIRC)
by davenull
Sat Apr 02, 2016 7:53 pm
Forum: Raspberry Pi OS
Topic: how to start with keyb NUMLOCK automatically?
Replies: 7
Views: 1993

Re: how to start with keyb NUMLOCK automatically?

I tried it in the LX terminal and in the Geany Editor, in both cases no numbers then.
After manually pressing NUMLOCK it's working of course
(I use a wireless keyb/mouse kit by LogiLink)
by davenull
Sat Apr 02, 2016 7:04 pm
Forum: Raspberry Pi OS
Topic: how to start with keyb NUMLOCK automatically?
Replies: 7
Views: 1993

Re: how to start with keyb NUMLOCK automatically?

no, unfortunately does not work, no numbers if I press the numpad keys, just Ins, PgUp, PgDn, Home, End...
by davenull
Sat Apr 02, 2016 6:12 pm
Forum: C/C++
Topic: read keyboard keypress: function keys
Replies: 78
Views: 14713

read keyboard keypress: function keys

hey, in my program for my mobile robot I would like to switch between some display charts by pressing the function keys (e.g., a chart table of send/receive buffer contents, or a i2c array buffer, or a picture showing the environmental room and the robot's position) for "common" keys I'm using int c...
by davenull
Sat Apr 02, 2016 5:08 pm
Forum: Raspberry Pi OS
Topic: how to start with keyb NUMLOCK automatically?
Replies: 7
Views: 1993

how to start with keyb NUMLOCK automatically?

hey,
how is it possible to start with keyb NUMLOCK automatically?
by davenull
Sat Apr 02, 2016 8:49 am
Forum: OpenVG
Topic: New to graphics programming - what to learn?
Replies: 13
Views: 17619

Re: New to graphics programming - what to learn?

wow, amazing!
great source code examples, marvelous clearly arranged!
congratulations!

did you publish it on Github?

How can I "apt-get install" raylib on my Raspi to #include the lib into my own Raspi gpp C/C++ programs?
by davenull
Fri Apr 01, 2016 8:56 pm
Forum: C/C++
Topic: safety shutdown for motor controlling pins
Replies: 4
Views: 620

Re: safety shutdown for motor controlling pins

just an idea:
is there perhaps a watchdog implemented by the MCU or Linux which could be assigned to the value of the semaphore and thus cares about involuntary motor activity?
by davenull
Fri Apr 01, 2016 7:33 pm
Forum: C/C++
Topic: safety shutdown for motor controlling pins
Replies: 4
Views: 620

safety shutdown for motor controlling pins

hey, I have a program for a mobile robot. Currently it's just remote-controlled but additional "behaviours" will be implemented by a subsumption architecture in future. The motor movements are currently controlled by motor API functions: //************************************************************...

Go to advanced search