Detection of custom keyboard keys - keyboard

I have a X7 G800V keyboard with 15 custom keys. The problem is they are not detected in anything but the software that comes with the keyboard which is a real cave eat since I can't use them in photoshop, word or any other program. Is there any way to make them detectable? I am open for ideas even if they include writing my own driver, although I may need some tips on that but still I am open for learning. After all the guys from A4Tech do it with their software and I think they are not even installing any drivers.
PS: I am sorry for this not being an exactly programming question.

If the OS doesn't support these keys, I don't see a way to process them, unless you can configure your driver to communicate them to the OS as some other key. For instance if you press key Special1, the driver tells the operating system to process it as Play.
Or you might consider to write a driver yourself, if the driver is open-source, or an API is available.

Related

How Could I Create This Type of Machine?

So I have a computer. It has programs on it already. If I delete those programs, I would be left with an operating system that is able to run commands. I could create my own programs from that point, but I would be limited to the constraints of the operating system already loaded onto the machine. What I would like to do is remove the operating system from the computer entirely and be left only with a blank screen and a cursor where I could type whatever I want. I want to be able to create my own program without having to run an operating system program behind it. I do not understand how the physical machine would be able to process the strings of characters that I type into it and produce its own response, which would then be displayed on the screen, but obviously someone has done it before, otherwise I would not have the machine that I am typing on right now.
(I apologize for the run on sentences but I do not know how to say what I want to say right now.)
My goal here is to have a computer, kind of like the Apple 2, where the only thing that I could do with it is type into a text line and see characters pop up on the screen. My goal on top of that goal is to develop a program that would hide in the background of the machine, so that there would still only be a cursor on screen, but the program would make it so that when I type any simple question into the screen, such as, "How are you feeling today?", I would receive a response like, "I am doing quite well, thank you. How are you?".
Does anybody have any idea how I would be able to start this project properly?
If you need to ask this question, you need to learn more than one answer on SO can provide.
Operating system is needed even to get the cursor thingy on screen.
If you are serious about the idea - you might want to start with a microcontroller, such as Arduino. They are more powerful than Apple 2 and they will allow you to write programs and boot straight into them. Adding some kind of terminal IO will not be hard - at least comparing to bootstrapping a program on an actual PC.
A good starting point for a project like this is to learn about operating systems in general. It is a vast topic but you don't have to know everything.
When we speak of an operating system we have in mind a large system that provides capabilities like managing memory, reading and writing files to permanent storage and interacting with input and output such as keyboards and displays. We are also usually thinking of a large number of higher level software applications. Think about commands like dir or ls as programs that come along with the operating system. Of course with a GUI based OS we also have windows and buttons and a wide variety of controls to consider.
The good news is that in order to get started you don't need to be an expert on everything and you certainly don't have to start with a full-blown OS.
The other good news is that the topic can be broken down into byte-sized pieces. A great introduction to the fundamentals you will need is Charles Petzold's Code The Hidden Language of Hardware and Software
Petzold begins with discussions of the inventions of Morse code and Braille, adds electricity, number systems, Boolean logic, and the resulting epiphanies required to put them all together economically. With these building blocks he builds circuits, relays, gates, switches, discusses the inventions of the vacuum tube, transistors, and finally the integrated circuit.
The last portion of the book contains a grab bag of subjects such as implementation of floating point math, operating systems, and the various refinements that have occurred in the latter half of the twentieth century.
Once you have a feel for the fundamentals a good next step in learning about operating systems is to study one that provides as few capabilities as possible. Take a look at MINIX
MINIX originally was developed in 1987 by Andrew S. Tanenbaum as a teaching tool for his textbook Operating Systems Design and Implementation. Today, it is a text-oriented operating system with a kernel of less than 6,000 lines of code. MINIX's largest claim to fame is as an example of a microkernel, in which each device driver runs as an isolated user-mode process—a structure that not only increases security but also reliability, because it means a bug in a driver cannot bring down the entire system.
Have fun.

How to turn off a GPIO port on BeagleBone Black Wireless

My task is to create a program to open and close an electronic valve that is plugged into GPIO ports on my BeagleBone, by using TTL signals.
Questions:
Can I do this?
How do I make an executable file to do this?
Can someone refer me to documentation on this?
Am I going about this in the wrong way?
Thank you.
P.S. If you couldn't already tell I am very new to this.
Yes
There are many ways. It's actually a pretty standard Linux computer and you can use any of a "million" different programming languages to achieve this. This also means you don't have to look for "Beaglebone" specific instructions (beyond the GPIO info below), but your problem is just "How do I write a program that can write text to a file on Linux?". Bonus: This sounds easy and it is easy!
Yes, take a look here for the hardware specific part:
https://github.com/adafruit/adafruit-beaglebone-io-python/issues/157
It describes fairly well both the new and the old sysfs interfaces you can use to manipulate GPIOs.
Depending on the language of your choice, there may already be bindings or a library to abstract this.
No (only based on the information you provided, are there other requirements?)
We all were new at this at some point, don't worry.
Sidenote: It's generally a good idea to make sure that you are running the latest firmware. In case of the BB-Family you can find them here: http://beagleboard.org/latest-images

OCaml read pressed key without graphical window

Edit. I am working in a Windows environment.
I want to write a simple game in console output with OCaml. I need to be able to use a 'read_key' function. But :
The graphics module throws an error : Exception: Graphics.Graphic_failure "graphic screen not opened". But I do not want to open the graphic window.
The function read_line forces the user to press "return" after every key press...
It is not possible to implement such function using pure OCaml. You will need to call to platform specific libraries. It is not an OCaml problem, this is the same for other languages, including python, java, c, etc. Actually, interacting with a terminal in a portable way is kind of rocket science. Mostly for historical reasons.
I suspect, that you don't want to get into such troubles, so I can suggest few easy solutions:
Use OCamlSDL library, - you're developing a game, and SDL is for games
Use Graphics module, yes you will need to open the graphic window, and your game will not be a pure console... but maybe this is not a big issue. Also, you can make a black background and emulate a terminal :)
Install Cygwin version of OCaml. You will get a unix-like environment, and Unix.tc_* will start to work.
Switch to a normal operating system. Where by normal I mean Unix-like. You can use virtual machine, or containers, like Docker, for a first time.

Is There A Way To Detect A Key Logging Software?

I might write a program to detect malicious (or non-malicious) software that is key logging (logging key strokes to gain information).
What tactics would be used?
Is there certain code to look for?
Are there certain locations I should search?
I prefer Java or Perl as I am fluent in those languages
Would these languages work?
Is there a better language to use for this case?
What would be used?
Code?
Algorithms?
Function?
I think it depends on what you are attempting to do. If you are looking for known keylogging programs, you could use any software that can search the file system to view file signatures. However, it sounds like you want to detect unknown programs. I do not believe this is strictly possible. Keylogging applications can passively listen to the keystrokes so there is not an active signature you could look for. It would probably be easier to understand the software that is supposed to run on your computer and then detect any new software that starts to run. It wouldn't necessarily be keystroke logging software, but it would be unauthorized software (or at least yet to be authorized software).
Keystrokes are broadcast to the system as events that you can subscribe to in your application. This is how games and other programs use the keyboard input. The entire system knows when a key is hit and which key it was. You can't know who is listening.
To put it another way, if this were possible, it would kill software keystroke loggers since every anti-virus and anti-spyware application would have an option to detect and remove all of these types of software. They have an option similar to this, but it is based upon known signatures of known keystroke loggers.
As a program trying just to figure if it's input is being key-logged, for badly written key-loggers, you can look for some time-patterns, like periodic delays when the logger recycle buffers, but normally key-loggers are very well-written and will inject themselves in the driver chain and so will be indiscernible from the normal chain.
In that case the only hope to detect key-loggers is to inspect the driver chain looking for non-standard drivers (but some key-loggers can infect standard drivers) which isn't particularly easy in Windows-land (such low level inspection).
One would need to plug into the anti-virus/anti-malware hooks to be able to really access not only the driver chain definitions, but the real code being executed, to detect if some key-logging is takeing place, and that is hard, full of bureaucracy, and almost undoable in anything but C/C++

Writing data over RxTx using usbserial?

I'm using the RxTx library over usbserial on a Linux distro. The RxTx lib seems to behave quite differently (in a bad way) than how it works over serial.
One of my biggest problems is that the RxTx SerialPortEvent.OUTPUT_BUFFER_EMPTY does not work on linux over usb serial.
How do I know when I should write to the stream? Any indicators I might have missed?
So far my experience with writing and reading concurrently have not been great. Does anyone know if I should lock the DATA_AVAILABLE handler from being invoked while I'm writing on the stream? Or RxTx accepts concurrent read/writes?
(perhaps slightly off-topic, but here goes)
I'm not familiar with that particular library, but I can assure you from dire experience (I work in the security systems (as in: hardware security devices) business, where RS-232 is heavily used) that not all USB-serial converters are born equal. Many such devices so not properly emulate all RS-232 lines, and many don't even handle any comms without flow control. Before blaming the library, try to confirm that the hardware actually does what it's supposed to do.
Without wanting to endorse a particular product or brand, the best (as in: least buggy) USB-serial converter I have come across in years is the USA-19HS.
Using RxTx over usb-to-serial you can't set notifyOnOutput to true otherwise it locks up completely.
I've learned this the hard way. This problem is documented on a few web sites over the internet.
I'm running it on Linux and I believe that this is a Linux only issue, although I can't confirm that.
As for the link you've given me... I've seen the SimpleReader and SimpleWriter examples, but these don't represent a real world application. It is not multi-threaded, assumes a read has the full data it needs instead of buffering reads, etc.
Thanks,
Jeach!

Resources