Skip to main content

Patch for Swedish keyboard layout in osx2x

osx2x is a handly little program used to interface OS X with any X server. It basically extends your screen so that when the cursor is moved to (for example) right edge, the cursor and keyboard is mapped to the X server instead.

Anyhow, currently it does not support any other layouts than US or DE. This is a patch for the X11 portion of osx2x - not VNC.


//
// keymap.c
// osx2x
//
// Copyright (c) Michael Dales 2002, 2003
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// Neither the name of Michael Dales nor the names of its contributors may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT S HALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS I NTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//

/* snip */

const int keymap_us[128] = {
XK_a,
XK_s,
XK_d,
XK_f,
XK_h,
XK_g,
XK_z,
XK_x,
XK_c,
XK_v,
XK_section, // 10
XK_b,
XK_q,
XK_w,
XK_e,
XK_r,
XK_y,
XK_t,
XK_1,
XK_2,
XK_3, // 20
XK_4,
XK_6,
XK_5,
XK_dead_acute,
XK_9,
XK_7,
XK_plus,
XK_8,
XK_0,
XK_dead_diaeresis, // 30
XK_o,
XK_u,
XK_aring,
XK_i,
XK_p,
XK_Return,
XK_l,
XK_j,
XK_adiaeresis,
XK_k, //40
XK_odiaeresis,
XK_apostrophe,
XK_comma,
XK_minus,
XK_n,
XK_m,
XK_period,
XK_Tab,
XK_space,
XK_less, //50
XK_BackSpace,
-1,
XK_Escape,
XK_Super_R,
XK_Alt_L, // 55
XK_Shift_L,
XK_Caps_Lock,
XK_Meta_L,
XK_Control_L,
XK_Shift_R, // 60
XK_ISO_Level3_Shift,
XK_Control_R,
-1,
-1,
XK_KP_Decimal,
-1,
XK_KP_Multiply,
-1,
XK_KP_Add,
-1, // 70
-1,
-1,
-1,
-1,
XK_KP_Divide,
XK_KP_Enter,
XK_KP_Subtract,
XK_KP_Subtract,
-1,
-1, // 80
-1,
XK_KP_0,
XK_KP_1,
XK_KP_2,
XK_KP_3,
XK_KP_4,
XK_KP_5,
XK_KP_6,
XK_KP_7,
-1, // 90
XK_KP_8,
XK_KP_9,
-1,
-1,
-1,
XK_F5,
XK_F6,
XK_F7,
XK_F3,
XK_F8, // 100
XK_F9,
-1,
XK_F11,
-1,
-1,
-1,
-1,
-1,
XK_F10,
XK_Menu, // 110
XK_F12,
-1,
-1,
XK_Insert,
XK_Home,
XK_Page_Up,
XK_Delete,
XK_F4,
XK_End,
XK_F2, // 120
XK_Page_Down,
XK_F1,
XK_Left,
XK_Right,
XK_Down,
XK_Up,
-1,
};

Comments

Popular posts from this blog

Buying an IBM Mainframe

I bought an IBM mainframe for personal use. I am doing this for learning and figuring out how it works. If you are curious about what goes into this process, I hope this post will interest you.

I am not the first one by far to do something like this. There are some people on the internet that I know have their own personal mainframes, and I have drawn inspiration from each and every one of them. You should follow them if you are interested in these things:
@connorkrukosky@sebastian_wind@faultywarrior@kevinbowling1 This post is about buying an IBM z114 mainframe (picture 1) but should translate well to any of the IBM mainframes from z9 to z14.

What to expect of the process Buying a mainframe takes time. I never spent so much time on a purchase before. In fact - I purchased my first apartment with probably less planning and research. Compared to buying an apartment you have no guard rails. You are left to your own devices to ensure the state of whatever thing you are buying as it likely…

Powering a mainframe

The last few days have been eventful. I was contacted by the datacenter that the mainframe's cage is now ready for moving in, and the power has been made available. Very exciting! I grabbed my home-made power cables (more on that later) and my best screwdrivers and set off to the datacenter.


The datacenter staff, not needing a forklift in their day-to-day, had managed to solicit the services of a forklift, the associated operator, and some very handy folks to help navigate the mainframe from the storage space to its final location.



After some intense period of fighting the inclination of the road between the storage facility and the cage (and a door that was a bit too small) it was finally in place. Incidentally we were forced to trust the wheels on this pretty rough floor. I did not expect it to roll that well on raw concrete, I was pleasantly surprised. This thing is a tank!

Now, everybody wanted to see if it was working. My machine did not come with a power cable so I had to so…

Open Datacenter Hardware - Leopard Server

Introduction The Leopard is an OpenRack v1 compliant 12V server commissioned by Facebook to offer compute power. It consists of 2x Intel Xeon E5-2678 v3 and is available with either DDR3 or DDR4 memory. The model is manufactured by two vendors primarily: Quanta and Wiwynn.

Leopard features a 24x PCIe slot which can fit either a PCIe card with low profile, or a riser card with 1x 16x and 1x 8x slots. The server also supports a 3.5" SATA drive as well as either an mSATA or an M.2 drive mounted on the motherboard.

Connectivity wise Leopard has a mezzanine card slot allowing for example 10Gb/s or 25Gb/s Ethernet.

Figure 1 and figure 2 shows the server layout. The server is made to fit inside an OpenRack v1 enclosure, at which point it looks something like figure 3. Due to power constraints an OpenRack v1 can fit 30 of these servers before power starts to become an issue. The Leopard servers that the organization Serverfarm Upstate provides are all fitted with 256GiB DDR3 RAM and 2x …