Programming :: Raw Access To Keycodes/scancodes From Userspace?

Aug 27, 2010

Is there an interface whereby a userspace program can retrieve the raw keycodes/scancodes from a keyboard? I'm trying to make something in the way of a piano keyboard, and I need to know when keys are pressed (possibly simultaneously), and when they are released.

View 14 Replies


ADVERTISEMENT

Programming :: Access Generic Netlink From Userspace?

Jun 7, 2010

I am trying to access a generic netlink family to send messages from user-space to the kernel. I am using libnl example here [URL].. The problem is that I keep getting

Code:
error: netlink/genl/genl.h: No such file or directory
error: netlink/genl/ctrl.h: No such file or directory
You would think I have not installed libnl and libnl-devel but I have.

[Code]...

View 1 Replies View Related

Programming :: Calling Kernel Functions From Userspace?

Feb 5, 2010

I'm trying to call some kernel functions from userspace, but I'm not sure if I'm doing it right. The functions control a pulse width modulator on an embedded platform. To pick one at random, the function:

Code:
struct pwm_device *pwm_request(int pwm_id, const char *label);
is defined in linux/pwm.h, and the implementation uses the macro EXPORT_SYMBOL(pwm_request), so I should be able to call this from user-space... right?

Anyway, I've got linux/pwm.h to #include in my source so the compiler knows what it's doing, but what do I link against? The only place in by kernel build tree where I can see a symbol pwm_request defined is in object files like vmlinux.o, built-in.o in the directory, etc. which I don't think I should be linking against.

View 2 Replies View Related

Hardware :: Apple Keyboard Constantly Changing Keycodes In X?

Feb 17, 2010

despite scorning the average Mac fanboy, I recently acquired a nice Apple USB Keyboard (aluminium model) which I admired for both design and quality. Unfortunately, Linux doesn't seem to like it very much - most importantly, the keyboard constantly keeps on changing keycodes and keymap, an issue I never had before. For instance, most of my bindings to close, maximize etc. lie on the "less" key (which is next to LShift on a German layout), but after every reboot, I have to reassign my bindings because either, it has traded places with "^" on a German layout (or "grave" on a US one), the key next to 1, or it has somehow changed its keycode and isn't recognized as "Less" any more, even though it kept its name.

Furthermore, most of the modifiers and similar keys like to throw a mixer dance, meaning that RAlt is suddenly Enter, Del is RCtrl, and so forth. All modifiers, the arrow keys, the block above them, all numpad non-numerical keys and Enter are involved. There seems to be no pattern or identifiable cause to this, except for when I start VirtualBox by VBoxSDL in fullscreen, it always does that (making me lose track of the Host Key, for instance). Also, after a while, the function keys seemed to be recognised - eject suddenly ejected my CDROM drive instead of executing its defined command, even though I never told it to. IIRC, no update to X preceeded this. As far as I can tell, all of these issues only appear in X, there is no problem on the command line. My system is a HP notebook (whose internal keyboard works a+) running a recently dist-upgraded Linux Sidux with kernel 2.6.32-1-slh.sidux and a fully upgraded X server with e17.

My keyboard definition with HAL is as follows:

<merge key="input.x11_options.XkbRules" type="string">base</merge>
<merge key="input.x11_options.XkbModel" type="string">pc105</merge>
<merge key="input.x11_options.XkbLayout" type="string">us,de</merge>
<merge key="input.x11_options.XkbOptions" type="string">grp:alt_space_toggle,terminate:ctrl_alt_bksp,compose:rwin</merge>

I tried various keyboard models etc. in e17s internal layout manager, but all of them end up completely mashing up my layout.

View 1 Replies View Related

Software :: Xorg Driver Used For The Keyboard Determine The Keycodes In X11?

Oct 2, 2010

Does the Xorg driver used for the keyboard determine the keycodes in X11? the ones seen by xev? The reason I ask is xev used to report my F14 key as 183, now it is 192. I think this happened when i switched to evdev from kbd.

View 2 Replies View Related

Networking :: Userspace Ethernet Packet Queue

Feb 12, 2010

I am a windows programmer. There I wrote a firewall and VPN System. It was easy. Simply, I USED WINPKFilter by ntkernel.com.What I need is to GET, Edit, and Send the raw Layer 2 packet before reaching to IP Stack.My friends were saying that linux is Ideal for Networking purposes. But for now I say that Linux is very bad in this field and I should say that windows is much better (I beg your pardon)After tens of hours for searching I got nothing good. The hook system of IPtables is not GOOD for me because it has not Ethernet header and also the packets are defragmented when I caught them.

I tried ebtables but it has no user space queue like IPTABLES. What I exactly need is to be able to reach to the chain of raw Ethernet packets and be able to modify them and resend or inject some ethernet packet packet. I Dont Want to go inside the KERNEL. (As windows I want a userspcae library). Dear linux expert I beg your help. Do not let me turn back to windows.

View 1 Replies View Related

General :: Less Hotkeys Not Working - Printing Keycodes Instead Performing Action

Mar 14, 2011

When I try something like

php -i | less

Less is not responding to hotkeys, but prints them like pressing "q" results in statusline

:q
PageDown
:^[[6~

Pressing ENTER like "executes" the keycode and less perfoems the action. Piping trivial small stuff work however... OS: Fedora 14

View 1 Replies View Related

Ubuntu Multimedia :: Find The Keycodes From Remote Control Input?

Sep 11, 2010

I've got an Emprex 3009URF remote control which I'm using to run XBMC and whilst it works fine for the most part there are a couple of things that I can do with a keyboard/mouse that I'm unable to do with the remote, for instance "right clicking" with the mouse that brings up a context menu, that is totally inaccessible from the remote.

Some things I was able to fix by editing .xsessionrc as instructed by another post elsewhere on the tubes, in the format of:

xmodmap -display :0 -e keycode 127 = space

however I don't know how to find the keycode and I don't know how to map that to a right click event.

View 2 Replies View Related

Ubuntu :: 11.04 - Hangs On Boot - Stopping Userspace Bootsplash

May 5, 2011

I was facing trouble getting my second monitor to even get detected (GeForce GTX 260) so out of desperation i apt-get'd nvidia-glx-179 drivers, I then used Jockey to enable that driver.

Since then, whenever Ubuntu tries to boot, it kills itself. And this is the process:

I power up the tower, the screen goes that nice brown shade as I wait for the graphical ubuntu logo to show me its loading, when it eventually does it very quickly cuts into a full screen not-really-interactive terminal window that shows the boot hanging at random spots in the boot process. Theres no clear pattern. At the time of writing, it hangs on "setting sensors limits" after "Starting AppArmor Profiles".

Im going to restart again, This time it hung up at "Checking battery state..." im going to restart again, Hung up at "PulseAudio configured for per-user sessions saned disabled; edit /etc/default/saned" Ill restart again, Hung up at "Stopping userspace bootsplash"

As much fun as this is, I have a website to develop and this is seriously setting me back. All i wanted was to display the site on my second monitor so i didnt have to swap window depths in rapid succession. This is.. more trouble than it seems to be worth... How do i NOT lose my data?

Its worth noting that all the lines say "OK" next to them, not one mentions a fail of any sort.
When i Ctrl+C to break out, it doesnt, just gives me ^C

View 9 Replies View Related

Server :: Scheme On Delivering A String Message Between Kernel And Userspace?

Jul 9, 2010

I used the Netlink mechanism before but it seems that it is not High-Efficiency.Is there another way or other ways better?

View 1 Replies View Related

Programming :: Access CD Audio Data?

May 13, 2011

I'm looking for a way to access the raw data on a CD.I have a small program that I'm using to play raw PCM data pushed into stdin.I'd assumed that I could just use:play-pcm < /dev/cdromBut this isn't producing any data.Will I need to do this programatically or is there a simple way for me to grab raw data from an audio cd in the same way I might do so for a data cd?

View 2 Replies View Related

Programming :: Access A Delphi 2-D Array In C#?

Jun 30, 2011

I'm trying access binary records that were created in Borland Delphi and stored in a SQL Server database (as a BLOB). What the heck is the syntax for accessing a two-D array in C#? Here's an example:

Code:

const
MAX_BOWLERS = 8;
gMAX_FRAMES = 40;
...
type

[code]...

I've successfully got a valid "GameRec" over to C#-land. I want to access array element "GameRec.Frames[iBowler, iFrame]".

How do I define a C# type "TFrames = Array[1..Max_Bowlers, 0..gMax_Frames] of TFrame;" so that I can do it?

View 4 Replies View Related

Programming :: How To Access Four Dimensional Array

May 23, 2010

I have never used multidimensional array for a long time so please consider this as a newbie question. I am editing a program that uses a 4 dimensional array and I think I'm losing track of the indexes.

day = 0 to 30
hour = 0 to 23
channel = 0 to 7
len = 0 to 63
unsigned char idx[day][channel][hour][len];

I have seen that the assignment to a string is
snprintf(idx[day][hour][channel], 64, "%s/%s", dayofmonth, hourofday);
Is this correct? Because when I access with a day argument, that day value goes into the hour part.

View 9 Replies View Related

Programming :: How To Access Packet Timestamp

Jan 8, 2011

I want to access the timestamp field of the packet being sent or received. I am not getting clear idea as to which ioctl I should use, and how it should be used in the program. Anyone explain rough flow of the program for accessing the timestamp.

View 5 Replies View Related

Programming :: How To Access Setdest Function In Ns2

Apr 25, 2011

i want to know how to access setdest function in ns2

View 1 Replies View Related

Programming :: How To Do A Direct Memory Access

Jul 26, 2011

I have a single board computer previously running DOS. I recently made Linux running on it. Now that the system is running Linux, I have to translate the code that was supported by DOS. The code has segments that allow direct access of memory mapped registers through the macro _MK_FP and do read/write. I have read that where DOS allows this kind of direct memory access, Linux does not. Is there a way to do this in Linux?

View 6 Replies View Related

Programming :: Log Access File Program?

Nov 11, 2010

i want to make a program to write the result of access to a file ,i mean for example a user wants to (open,delete,edit)a file but if he has no access to this file ,something write to a log file.so after that i can check which user got access denied by accessing to which file.or if any tools available that can do this?or if there is any built in log access file that record the permission denied to files?

View 4 Replies View Related

Programming :: Using Ssh Cant Access Applications Off Of Host?

Oct 20, 2010

I am using ssh on windows XP to remotely connect to a UNIX server that provides web application development services. The server is called snapper and is also designed to run computer-intensive engineering and GIS applications. I have been able to successful access the server. However, when I try to run an application I get an error message saying:Application initialization failed: no display name and no $DISPLAY environment variable

The ANSYS Launcher could not be started The most likely reason is that your DISPLAY environment variable I either not set (i.e. issue setenv DISPLAY dev:0.0 where dev is your device name) or is set to a device that is not accepting the connection. I was hoping someone could explain to me what the DISPLAY environment variable is and how to set it.

View 14 Replies View Related

Debian Programming :: Can't Access Math Function

Apr 30, 2015

When I try to compile this code:

#include <math.h>
int main (void) {
double x, y;
x = 2;
y = sqrt(x);
return 0;
}

With the command:

$ gcc test.c

I got this message:

/tmp/cc5QZmCN.o: In function 'main':
test.c:(.text+0x16): undefined reference to 'sqrt'
collect2: error: ld returned 1 exit status

I tried this on a fresh jessie install. I have the same problem on wheezy.

View 2 Replies View Related

Programming :: Access The Address Of A Character Pointer?

Jul 12, 2010

i was trying to access the address of the character pointer it gives me the values stored in the variable.

Code: #include<iostream>
using namespace std;
int main()
{
char *i;

[Code]....

why is my code not giving the address of the variable i when it is a character pointer.

View 2 Replies View Related

Programming :: Access In-memory Structure And Its Members?

Dec 13, 2010

I am implementing c program to access ext3 file system's metadata. I want to know how to access members of the in-memory superblock structure. I am able access on-disk ext3_super_block structure but dont know how to access in- memory structure and its members.

View 1 Replies View Related

Programming :: Access Another Process's Memory With A Twist?

Jul 31, 2010

I have been looking for a method for a while now that would allow me to access another process's memory without causing it to freeze. But with all of my googling I have found nothing

so, my question is: Is there a way to not lock a process while accessing it's "/proc/[PID]/mem" interface?

View 3 Replies View Related

Programming :: Access Not Within Mapped Region At Address

Jan 28, 2011

I am receiving that error through Valgrind, I don't know the meaning of the error so I don't know what to check.

View 2 Replies View Related

Programming :: Access Value From Nested Struct <c Language>?

Mar 11, 2010

I having a nested structures which are referenced with pointer variables :

example :
typedef struct {
int a ;
char *b ;
int *c ;
}EXP2 ;

[Code]...

While trying to access the value of sv.exp2->a it throws segmentation fault error.How to acess this variable ??

View 3 Replies View Related

Programming :: Can't Access To Content Of Array In For Loop

Mar 7, 2010

When I deal with an array in a function I con not access to the content of array in a for loop, but out of a for loop I can access to them! for example

[code]...

In a function when I send as parameter, in a for loop it prints the content of array and out of a for loop it prints the address of arr[i]

View 5 Replies View Related

Programming :: Convert Access Database To Mysql?

May 3, 2010

I'm trying to migrate my company server to linux, but i have a program that is designed in access what is the best way to move access tables to a mysql database so that i can program it in PHP?

View 3 Replies View Related

Programming :: Access Command Line Variables From Awk?

Feb 11, 2010

I am taking an argument from the command prompt for my shell script ie $1 and i need to use $1 in my awk part of the script.But it actually doesn't get any value when used in awk. accessing this command line argument in awk?

View 5 Replies View Related

Programming :: Ls -R Without Changing Access Time/date?

Aug 31, 2010

I am using cygwin in order to test a bash script that uses the ls -R command. When I use this, the access date of the subfolders are changed, and I need them to remain what they were before the command was run. I don't have access to a legitimate Linux system, so I'm not sure if this is the fault of cygwin or the ls command. The script is being used to find the last access date of all files underneath several subfolders and then return the latest date found in each subfolder as the last access date for that subfolder. For some reason, some of these folders have files in them that are newer than the folder's last access date, so the script is meant to give us a list of the true last access date for these folders.

View 5 Replies View Related

Programming :: Need To Monitor Samba Share Access

Jul 1, 2010

i want to do a script that check samba shares with command smbstatus and see if one of the folders is accessed by unauthorized user by comparing with list of authorized users.

View 5 Replies View Related

Programming :: Parsing Out Squid Access Log With Awk And Grep?

Apr 25, 2011

I'm trying to recreate a simple script I wrote to parse out the access.log to get a rough idea of websites that users are going to on our corp network. The issue I'm having is I want to pull out any line from access.log that ends in .com/ .org/ .net/ or whatever to only see what the user entered into the address bar and drop pictures, js's and everything else and log only this. so what I do is :awk '{print $8} | grep -e '[cong]|[ore]|[mgtv][/]'$ and nothing happens.I know there is an easier way to do this with awk alone,

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved