Search found 9 matches

by larry
Thu Sep 29, 2005 5:25 pm
Forum: Linux
Topic: Window Events
Replies: 2
Views: 1802

Window Events

I have some questions about events and the way they operate. It could be my misunderstanding or bugs under Linux. The following code demonstrates the issues:

OpenWindow(0, 0, 0, 400, 300, #PB_Window_SystemMenu|#PB_Window_ScreenCentered, "Test")
CreateGadgetList(WindowID())
result = LoadImage(1 ...
by larry
Sat Sep 17, 2005 6:05 pm
Forum: Linux
Topic: Serial Communications via API
Replies: 9
Views: 10343

Here is a pretty simple example. Set your port parameters in the stty command. Good Luck 8)

;
; ------------------------------------------------------------
;
; PureBasic - Serial Communications
; Larry Duarte
;
; ------------------------------------------------------------
;

#O_ACCMODE = 03
#O ...
by larry
Fri Sep 16, 2005 11:18 pm
Forum: Linux
Topic: Serial Communications via API
Replies: 9
Views: 10343

Got it! :D
Even with O_RDWR, you need cread in stty command. It is reading and writing perfectly. I hope this helps everyone who has been looking for serial communications.
by larry
Thu Sep 15, 2005 11:43 pm
Forum: Linux
Topic: Serial Communications via API
Replies: 9
Views: 10343

Serial Communications via API

Well, until some native support is provided, I am trying to implement serial communications via API functions. I am close, but have one problem. First I open the port with:
fd = open_("/dev/ttyS0", #O_NONBLOCK | #O_NOCTTY | #O_RDWR , 0)
I can write quite successfully with: (can see time on ...
by larry
Sat Sep 10, 2005 3:40 pm
Forum: Linux
Topic: InitKeyboard() Problem
Replies: 3
Views: 2160

InitKeyboard() Problem

I first posted this under Coding Questions but no one had an answer, this makes me believe it is a problem unique to Linux. I am running Fedora Core 4 and PureBasic 3.94 for Linux.

This program is in the examples provided by PB. I did not change it in any way. The beginning of the program is shown ...
by larry
Sat Sep 03, 2005 7:05 pm
Forum: Coding Questions
Topic: InitKeyboard problem
Replies: 9
Views: 2787

Thanks Netmaestro, but does not solve problem. The second code sample, correctly written, will not work. openscreen() is called before examinekeyboard(), and error still happens. Does keyboard commands not work under Linux :?:
by larry
Sat Sep 03, 2005 4:37 pm
Forum: Coding Questions
Topic: InitKeyboard problem
Replies: 9
Views: 2787

Everyone, thanks for the help so far. I should have been clearer in my original post, the code sample is just an excerpt showing the heart of the problem. The full code is shown below. It fails with the error I have been talking about, InitKeyboard() has been executed successfully. This program is a ...
by larry
Fri Sep 02, 2005 9:44 pm
Forum: Coding Questions
Topic: InitKeyboard problem
Replies: 9
Views: 2787

Jellybean, I tried that but it did not solve problem, thank you for your help.

The code I gave is a concise sample from PB programs in the example folder (ie: keyboard.pb). They should all work but fail because of this error.
by larry
Fri Sep 02, 2005 7:53 pm
Forum: Coding Questions
Topic: InitKeyboard problem
Replies: 9
Views: 2787

InitKeyboard problem

Sample code:

result = InitKeyboard()
a$ = Str(result)
MessageRequester("Result of InitKeyboard", a$, 0)
ExamineKeyboard()

Rresult of InitKeyboard() is 1 (good), ExamineKeyboard() (or any other keyboard command) produces: "[ERROR] InitKeyboard() must be called before use the keyboard commands ...