Desperately Seeking Help With XMODMAP...

Hi Guys, genuine noob here. I need some help with my first 'puter project -

I have a PI2 running Raspbian, a vintage ZX Spectrum computer & hacked USB keyboard chip.

I've used the USB keyboard chip to interface the keys from the Spectrum into my PI2.

Unfortunately, I'm having problems re-mapping the keys using XMODMAP...

Now this where it gets weird, let me explain -

Firstly, I've managed to successfully map the basic numbers & letters, so that the Spectrum keys trigger the appropriate KeySymbol.
However, I'm having serious problems with the modifier keys...

SHIFT_L is mapping perfectly, and will trigger CAPITALIZED letters.
BUT... I can't seem to get accurate results from my re-mapped ALTGR button -

It works fine for SOME keys, but for others it will behave like SHIFT_L or not work at all

So as you can see below, I've (attempted) to re-map the Spectrum's SYMBOL SHIFT key to 'MOD5' (altgr), so that the 'number' keys will trigger !,@,#,$,%,&,',(,) and _.

so for 12345767890, I SHOULD be getting !@#$&%'()_
But - instead I'm getting 12345&78)_
It's working fine for keys '6', '9' and '0' but NOT for the other keys....

GGGrrrrrr... I don't understand what's happening here

Anyway, this is my xmodmap code. Please help me!

# first, sort out CAPS SHIFT and SYMBOL SHIFT as a shift and AltGr key..
xmodmap -e "keycode 85 = Shift_L"
xmodmap -e "keycode 97 = Control_R"
xset -r 85 # prevent new shift from autorepeating
xset -r 97 # prevent new AlrGr from autorepeating
xmodmap -e "add shift = Shift_L"
xmodmap -e "remove control = Control_R"
xmodmap -e "add mod5 = Control_R"

# one key maps to 'Caps Lock', need to remove this function to get it working
xmodmap -e "remove lock = Caps_Lock"

# Right, standard keys now... top row first, left to right...
xmodmap -e "keycode 89 = 1 1 exclam exclam exclam"
xmodmap -e "keycode 88 = 2 2 at at at"
xmodmap -e "keycode 112 = 3 3 numbersign numbersign numbersign"
xmodmap -e "keycode 34 = 4 4 dollar dollar dollar"
xmodmap -e "keycode 33 = 5 5 percent percent percent"
xmodmap -e "keycode 60 = 6 6 ampersand ampersand ampersand"
xmodmap -e "keycode 173 = 7 7 apostrophe apostrophe apostrophe"
xmodmap -e "keycode 114 = 8 8 parenleft parenleft parenleft parenleft"
xmodmap -e "keycode 106 = 9 9 parenright parenright parenright"
xmodmap -e "keycode 86 = 0 BackSpace underscore underscore underscore"

I should also mention that I've asked this same question on the PI forum, and no one's replied -

https://www.raspberrypi.org/forums/v...8&t=108434&e=0

Hopefully I can get some help here, as this project is currently useless without being able to re-map the keys.

Many thanks


Similar Content



How To Disable Boot Messages To Be Printed On Screen During Boot Up

hello all,
i am using Centos 6. i want to disable boot log messages at the time of boot-up even after pressing any key like.. Esc,Alt+d,any arrow keys..

i tried to disable keys by using the command:
xmodmap -e "remove Escape = Escape" and all...
but its not working.
what should i do?? boot messages like this:

iptables: Applying firewall rules: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0:
Determining IP information for eth0... done.
[ OK ]
Starting system logger: [ OK ]
Starting system message bus: [ OK ]
Retrigger failed udev events[ OK ]
Starting snmpd: netlink: 12 bytes leftover after parsing attributes.
[ OK ]
Starting snmptrapd: [ OK ]
Starting sshd: [ OK ]
Starting mysqld: [ OK ]
Starting Dovecot Imap: [ OK ]
Starting postfix: [ OK ]
Starting mailgraph: [ OK ]
Starting httpd: [ OK ]
Starting crond: [ OK ]
Starting squid: .[ OK ]
Starting fail2ban: [ OK ]
Starting atd: [ OK ]

Help With Applying Passing Parameters

i need to complete this exercise but my code has some issues
HERE is the PRoblem:
Create a script that can accept ANY amount of numbers from the command line. Process the numbers one at a time, where numbers greater than 10 print “large”, numbers less than or equal to 10 print “small”
E.g. process 5 10 15 would print
small
small
large

and here is my code so far
if [ $@ -le "10" ]
then
echo "smaller"
else
echo "bigger"
shift
fi
if [ $@ -le "10" ]
then
echo "smaller"
else
echo "bigger"
shift
fi
if [ $@ -le "10" ]
then
echo "smaller"
else
echo "bigger"
shift
fi
if [ $@ -le "10" ]
then
echo "smaller"
else
echo "bigger"
shift
fi

any help would be greatly appreciated

"vconsole.conf" Show Unicode

Hi!

Here is mine configuration and I want make it show unicode(russian) in console, it works perfect in X11 but not when I logging into tty.

vconsole.conf
Code:
LOCALE="en_US.UTF-8"
KEYMAP="sv-latin1"
FONT_UNIMAP="lat1"
FONT_MAP="ISO8859-1"
CONSOLEFONT="ruscii_8x8"
HARDWARECLOCK="localtime"
TIMEZONE="Europe/Stockholm"
USECOLOR="yes"

Mutt Does Not Show Full Subject

I use following shell script to send email. But the subject of email always shows "This" instead of "This is L_1.R is finished". You may refer http://www.linuxquestions.org/questions/linux-newbie-8/how-to-define-variable-in-%60ssh%60-4175540566/
Code:
host_list=("c15-0330-01.ad.mtu.edu" "c15-0330-02.ad.mtu.edu" "c15-0330-03.ad.mtu.edu" "c15-0330-04.ad.mtu.edu")
program=("L_1" "L_2" "L_3" "L_4")
subject="The job is finished"
ssh -f c15-0330-01.ad.mtu.edu 'echo' "the job ${program[0]} is finished" '|' 'mutt "zwang10@mtu.edu" -s' "This is "${program[0]}".R is finished";

Bash Script For Xfce4 Powermanager Settings Switching Forth And Backward

i need a bash script to switch to zero second on ac the waiting time for turning off the monitor (highlighten in red). same as for on battery (highlighten in purple)

Code:
<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-power-manager" version="1.0">
  <property name="xfce4-power-manager" type="empty">
    <property name="power-button-action" type="empty"/>
    <property name="show-tray-icon" type="empty"/>
    <property name="logind-handle-lid-switch" type="bool" value="true"/> 
    <property name="dpms-on-ac-sleep" type="uint" value="1"/>
    <property name="dpms-on-ac-off" type="uint" value="2"/> 
    <property name="brightness-on-battery" type="uint" value="9"/> 
    <property name="dpms-on-battery-sleep" type="uint" value="1"/>
    <property name="dpms-on-battery-off" type="uint" value="2"/> 
    <property name="lock-screen-suspend-hibernate" type="bool" value="false"/>
    <property name="dpms-enabled" type="bool" value="true"/>
  </property>
</channel>

Rsync, Reliable "copy And Paste" Type Of Backup In Case Things Break?

What I did in windows was create images of my drive and restore them.

in linux I am running

Code:
rsync -aAXv --exclude={"/home/*","/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} /* /path/to/backup/folder

and this creates a folder for me with all my files, and apparently saves meta data like permissions and paths...

Since I'm using arch and things break sometimes,I'm booted into a CLI with errors and cannot figure my way out since I'm a noob... would I be able to just delete my entire root and replace it with the rsync backup without a problem?

Magic Key Unresponsive As Well As System Settings

I have been trying to run linux on a fujitsu Lifebook t series, and have two questions. One may solve the other. First, the system settings option in the top right drop down menu does not respond. When I click it nothing happens. Second I can't seem to find the right combination of keys for "Magic Key". This Fujitsu tablet has a Insert/PrtSc key and a Delete/SysRq key. When I try the key combinations outlined in what I have read, I get a Save screen shot dialog box. This keyboard requires a Fn key to be depressed for the second half (first half/second half) of the two keys I mentioned. I have tried :
the Alt + Insert/PrtSc,
Alt + Delete/SysRq,
Alt + Fn + Insert/PrtSc,
Alt + Fn + Delete/SysRq,
All of those combinations trigger the "Save screen shot dialog".
Thanks for any insight!
Wayne

Network Configuration For Redhat 7

I just installed Redhat 7 and try to config the network , add the IP address to network card , but I got the problem.

I modify the file /etc/sysconfig/network-scripts/ifcfg-enp0s3 , the configuration is as below , and then reboot .

DEVICE="enp0s3"
NETBOOT="yes"
HWADDR="08:00:27:15:38:B7"
TYPE="Ethernet"
BOOTPROTO="none"
NAME="enp0s3"
UUID="462f4834-4fe7-43a7-84e7-83b2722e94c1"
ONBOOT="yes"
IPADDR="192.168.1.1"
NETMASK="255.255.255.0"

After reboot , I use "ip addr show" still not shown the ip address , the ip address is still blank , would advise what is wrong ? thanks

Check Empty Variable Without Comments

Hello,

They gave me this:
Code:
#!/bin/bash

# Write error message on stderr and die
function die() {
  echo "$@" >&2
  exit 1
}

# Load var from properties files
function load() {
  for propertie in "$@" ; do
    [[ -f "${propertie}" ]] || die "load() : \"${propertie}\" don't exist !"
    while read ; do
echo "${REPLY%=*}"
echo "${REPLY#*=}"
      [[ -n "${REPLY%%=*}" && -z "${REPLY#*=}" ]] || die "load() : Variable \"${REPLY%%=*}\" is empty!"
      eval "${REPLY%%=*}"=\'"${REPLY#*=}"\'
    done < "${propertie}"
  done
}

load "manage_srcds.conf"
echo "SRCDS_TICKRATE=$SRCDS_TICKRATE"
echo "SRCDS_SCREEN=$SRCDS_SCREEN"
echo "SRCDS_SRCDS_GAME_NAME=$SRCDS_GAME_NAME"
echo "SRCDS_MAXPLAYERS=$SRCDS_MAXPLAYERS"

but, return:
Quote:
###################################################
###################################################
load() : Variable "###################################################" is empty!

cat manage_srcds.conf

I just wish that there was no empty variable excluding those who do not have integer.

Best regards,

Basic Bash Script

Code:
PREFIX=192.168.1
OCTET=1
while [ $OCTET -lt "255" ]; do
    echo -en "Pinging ${PREFIX}.${OCTET}..."
    ping -c1 -w1 ${PREFIX}.${OCTET} > /dev/null 2>&1
    if [ "$?" -eq "0" ]; then
       echo "OK"
    else
       echo "Failed"
    fi
    let OCTET=$OCTET+1
done

My question is, in the penultimate line, why is it OCTET, and not $OCTET, with a dollar before it, meaning, the variable?

What if it were written:
Code:
let $OCTET=$OCTET+1

Like in C++ (I think) or Python or whatever?