default partial alphanumeric_keys
xkb_symbols "basic" {

    // Describes the differences between a very simple en_US
    // keyboard and a Norwegian keyboard with dead key support
    // and all of ISO-8859-1 characters available.

    include "latin(type2)"

    name[Group1]="Norwegian";

    key <AB09>	{ [    period,      colon,   ellipsis, periodcentered ]	};
    key <AB10>	{ [     minus, underscore,       endash,       emdash ]	};
    key <AD04>	{ [         r,          R,   registered,    trademark ]	};
    key <AD10>	{ [         p,          P,     Greek_pi,     Greek_PI ]	};
    key <AE05>	{ [         5,    percent,      onehalf,    0x1002030 ]	};

    key <AE11>	{ [      plus,   question,    plusminus, questiondown ]	};
    key <AE12>	{ [ backslash, dead_grave,   dead_acute,      notsign ]	};


    key <AC10>	{ [    oslash,   Ooblique,   dead_acute, dead_doubleacute ] };
    key <AC11>	{ [        ae,         AE, dead_circumflex, dead_caron]	};
    key <TLDE>	{ [       bar,    section,    brokenbar,    paragraph ]	};

    key <BKSL>	{ [apostrophe,   asterisk, dead_doubleacute, multiply ]	};
    key <LSGT>	{ [      less,    greater,      onehalf, threequarters]	};

    include "nbsp(level3n)"
    include "keypad(ossmath)"
    include "kpdl(comma)"

    include "level3(ralt_switch)"
};

partial alphanumeric_keys
xkb_symbols "nodeadkeys" {

    // Modifies the basic Norwegian layout to no dead keys

    include "no(basic)"

    name[Group1]="Norwegian (no dead keys)";

    key <AE12>	{ [ backslash,      grave,        acute,       ogonek ]	};
    key <AD12>	{ [ diaeresis, asciicircum,  asciitilde,       macron ]	};
    key <AC10>	{ [    oslash,   Ooblique,        acute,  doubleacute ]	};
    key <AC11>	{ [        ae,         AE,  asciicircum,        caron ]	};
    key <AB08>	{ [     comma,  semicolon,      cedilla,       ogonek ]	};
    key <AB09>	{ [    period,      colon, periodcentered,   abovedot ]	};
};

partial alphanumeric_keys
xkb_symbols "winkeys" {

     include "no(basic)"
     name[Group1]="Norwegian (Windows)";
     include "eurosign(5)"
};

// Norwegian Dvorak
partial alphanumeric_keys
xkb_symbols "dvorak" {
    include "us(dvorak)"

    name[Group1]="Norwegian (Dvorak)";

    key <TLDE> { [	  bar,	section, brokenbar, paragraph	] };

    key <AE01> { [	    1,	exclam, exclamdown, onesuperior	] };
    key <AE02> { [	    2,	quotedbl,   at,     twosuperior	] };
    key <AE03> { [	    3,	numbersign, sterling, threesuperior ] };
    key <AE04> { [	    4,	currency,   dollar,  onequarter	] };
    key <AE05> { [	    5,	percent,    onehalf,	onehalf	] };
    key <AE06> { [	    6,	ampersand,  threequarters, threequarters ] };
    key <AE07> { [	    7,	slash,      braceleft, division	] };
    key <AE08> { [	    8,	parenleft,  bracketleft		] };
    key <AE09> { [	    9,	parenright, bracketright	] };
    key <AE10> { [	    0,	equal,	    braceright		] };
    key <AE11> { [	 plus,	question,   plusminus, questiondown ] };
    key <AE12> { [  backslash,	grave,	    dead_acute,	dead_grave ] };

    key <AD01> { [       aring,	Aring,  braceright, bracketright ] };
    key <AD02> { [	comma,	semicolon, dead_cedilla, cedilla ] };
    key <AD03> { [      period,	colon,  periodcentered		 ] };
    key <AD04> { [	    p,	P,      thorn,	THORN		 ] };
    key <AD05> { [	    y,	Y,      yen			 ] };
    key <AD06> { [	    f,	F,      ordfeminine		 ] };
    key <AD08> { [	    c,	C,      ccedilla, copyright	 ] };
    key <AD09> { [	    r,	R,      registered		 ] };
    key <AD11> { [  apostrophe,	asterisk, dead_circumflex, acute ] };
    key <AD12> { [dead_diaeresis, dead_circumflex, dead_tilde, dead_caron ] };

    key <AC03> { [	    e,	E,      EuroSign,	cent	 ] };
    key <AC05> { [	    i,	I,      idotless,       Iabovedot] };
    key <AC06> { [	    d,	D,      eth,		ETH	 ] };
    key <AC10> { [	    s,	S,      ssharp,		U1E9E	 ] };
    key <AC11> { [	minus,	underscore, hyphen,	diaeresis] };

    key <AB01> { [	   ae,	AE,     braceleft,	bracketleft] };
    key <AB05> { [	    x,	X,      multiply		 ] };
    key <AB07> { [	    m,	M,	mu			 ] };
    key <BKSL> { [	 less,	greater, guillemotleft, guillemotright	] };

    key <SPCE> { [	 space,	space, nobreakspace, nobreakspace] };

    key <LSGT> { [	oslash,	Ooblique,  bar,	backslash	 ] };

    // fixed https://bugs.freedesktop.org/show_bug.cgi?id=4397
    include "level3(ralt_switch)"
};

partial alphanumeric_keys
xkb_symbols "smi" {

    // Northern Sami keyboards for Finland, Norway and Sweden
    //
    // Describes the differences between a very simple en_US
    // keyboard and a Norwegian Northern Sami keyboard (with
    // dead-key support) according to the spec on
    // http://www.hum.uit.no/a/trond/se-lat9-no-keys.html
    // Written by Børre Gaup <boerre.gaup@pc.nu>.

    include "latin"

    name[Group1]= "Northern Saami (Norway)";

    key <AE01>	{ [         1,     exclam,    copyright,   exclamdown ]	};
    key <AE02>	{ [         2,   quotedbl,           at,   registered ]	};
    key <AE03>	{ [         3, numbersign,     sterling,         less ]	};
    key <AE04>	{ [         4,     dollar,       dollar,      greater ]	};
    key <AE05>	{ [         5,    percent,        U2022,        U2030 ]	};
    key <AE06>	{ [         6,  ampersand,      section,    paragraph ]	};
    key <AE07>	{ [         7,      slash,    braceleft,          bar ]	};
    key <AE08>	{ [         8,  parenleft,  bracketleft,    braceleft ]	};
    key <AE09>	{ [         9, parenright, bracketright,   braceright ]	};
    key <AE10>	{ [         0,      equal,   braceright,     notequal ]	};
    key <AE11>	{ [      plus,   question,     division, questiondown ]	};
    key <AE12>	{ [ backslash,      grave,        acute,   asciitilde ]	};

    key <AD01>	{ [    aacute,     Aacute,            q,            Q ]	};
    key <AD02>	{ [    scaron,     Scaron,            w,            W ]	};
    key <AD03>	{ [         e,          E,       eacute,       Eacute ]	};
    key <AD04>	{ [         r,          R,   registered,    trademark ]	};
    key <AD06>	{ [         y,          Y,       yacute,       Yacute ]	};
    key <AD07>	{ [         u,          U,   udiaeresis,   Udiaeresis ]	};
    key <AD08>	{ [         i,          I,   idiaeresis,   Idiaeresis ]	};
    key <AD09>	{ [         o,          O,           oe,           OE ]	};
    key <AD11>	{ [     aring,      Aring,  acircumflex,  Acircumflex ]	};
    key <AD12>	{ [       eng,        ENG,     quotedbl,  asciicircum ]	};

    key <AC01>	{ [         a,          A,       agrave,       Agrave ]	};
    key <AC02>	{ [         s,          S,       ssharp,   apostrophe ]	};
    key <AC04>	{ [         f,          F,  ordfeminine,  ordfeminine ]	};
    key <AC05>	{ [         g,          G,       gcaron,       Gcaron ]	};
    key <AC06>	{ [         h,          H,        U01E5,        U01E4 ]	};
    key <AC07>	{ [         j,          J,      notsign,     multiply ]	};
    key <AC08>	{ [         k,          K,        U01E9,        U01E8 ]	};
    key <AC09>	{ [         l,          L,       degree,       hyphen ]	};
    key <AC10>	{ [    oslash,   Ooblique,   odiaeresis,   Odiaeresis ]	};
    key <AC11>	{ [        ae,         AE,   adiaeresis,   Adiaeresis ]	};
    key <TLDE>	{ [       bar,    section,    brokenbar,    paragraph ]	};

    key <BKSL>	{ [   dstroke,    Dstroke,   apostrophe,     asterisk ]	};
    key <AB01>	{ [         z,          Z,        U0292,        U01B7 ]	};
    key <AB02>	{ [    ccaron,     Ccaron,            x,            X ]	};
    key <AB03>	{ [         c,          C,     ccedilla,     Ccedilla ]	};
    key <AB04>	{ [         v,          V, lessthanequal, guillemotleft ] };
    key <AB05>	{ [         b,          B, greaterthanequal, guillemotright ] };
    key <AB06>	{ [         n,          N, leftsinglequotemark, leftdoublequotemark ] };
    key <AB07>	{ [         m,          M, rightsinglequotemark, rightdoublequotemark ]	};
    key <AB08>	{ [     comma,  semicolon, singlelowquotemark, doublelowquotemark ] };
    key <AB09>	{ [    period,      colon,     ellipsis, periodcentered ] };
    key <AB10>	{ [     minus, underscore,       endash,       emdash ]	};

    key <LSGT>	{ type[Group1] = "FOUR_LEVEL",
                  [    zcaron,     Zcaron,        U01EF,        U01EE ]	};

    include "level3(ralt_switch)"
};

partial alphanumeric_keys
xkb_symbols "smi_nodeadkeys" {

    // Modifies the basic Norwegian layout to no dead keys

    include "no(smi)"

    name[Group1]= "Northern Saami (Norway, no dead keys)";

    key <AE12>	{ [ backslash,      grave,        acute,       ogonek ]	};
};

// Copied from macintosh_vndr/no
partial alphanumeric_keys
xkb_symbols "mac" {

    // Describes the differences between a very simple en_US
    // keyboard and a very simple Norwegian keyboard.

    include "latin(type4)"
    name[Group1]= "Norwegian (Macintosh)";

    key <TLDE>	{ [       bar,    section     ]	};
    key <AE03>	{ [         3, numbersign,     sterling,     sterling ]	};
    key <AE04>	{ [         4,   currency,       dollar,       dollar ]	};
    key <AE06>	{ [         6,  ampersand, threequarters, fiveeighths ]	};
    key <AE07>	{ [         7,      slash,          bar,    backslash ]	};
    key <AE08>	{ [         8,  parenleft,  bracketleft,    braceleft ]	};
    key <AE09>	{ [         9, parenright, bracketright,   braceright ]	};
    key <AC10>	{ [    oslash,   Ooblique,   odiaeresis,   Odiaeresis ]	};
    key <AE11>	{ [      plus,   question     ]	};
    key <AC11>	{ [        ae,         AE     ]	};
    key <AD11>	{ [     aring,      Aring     ]	};
    key <AE12>	{ [ dead_grave, dead_acute,       acute,  dead_ogonek ]	};
    key <AD12>	{ [ diaeresis, asciicircum,  asciitilde,  dead_macron ]	};
    key <BKSL>	{ [        at,   asterisk     ]	};
};

partial alphanumeric_keys
xkb_symbols "mac_nodeadkeys" {

    // Modifies the basic Norwegian layout to no dead keys
    include "no(mac)"
    name[Group1]= "Norwegian (Macintosh, no dead keys)";

    key <AE12>	{ [      grave,     acute,        acute,       ogonek ]	};
    key <AD12>	{ [  diaeresis, asciicircum, asciitilde,       macron ]	};
};

partial alphanumeric_keys
xkb_symbols "colemak" {

    // Colemak layout - http://colemak.com/
    // Q W F P G   J L U Y Ø Å ¨
    // A R S T D   H N E I O Æ '
    // < Z X C V   B K M , . -
    include "no(basic)"
    name[Group1]= "Norwegian (Colemak)";

    key <AB06>	{ [         k,          K,          kra,    ampersand ] };
    key <AC02>	{ [         r,          R,   registered,    trademark ] };
    key <AC03>	{ [         s,          S,       ssharp,      section ] };
    key <AC04>	{ [         t,          T,        thorn,        THORN ] };
    key <AC05>	{ [         d,          D,          eth,          ETH ] };
    key <AC07>	{ [         n,          N ] };
    key <AC08>	{ [         e,          E,     EuroSign,         cent ] };
    key <AC09>	{ [         i,          I,   rightarrow,     idotless ] };
    key <AC10>	{ [         o,          O,           oe,           OE ] };
    key <AD03>	{ [         f,          F,      dstroke,  ordfeminine ] };
    key <AD04>	{ [         p,          P,     Greek_pi,     Greek_PI ] };
    key <AD05>	{ [         g,          G,          eng,          ENG ] };
    key <AD06>	{ [         j,          J ] };
    key <AD07>	{ [         l,          L,      lstroke,      Lstroke ] };
    key <AD08>	{ [         u,          U,    downarrow,      uparrow ] };
    key <AD09>	{ [         y,          Y,    leftarrow,          yen ] };
    key <AD10>	{ [    oslash,   Ooblique,   dead_acute, dead_doubleacute ] };
};

// EXTRAS:

partial alphanumeric_keys
	xkb_symbols "sun_type6" {
	include "sun_vndr/no(sun_type6)"
};

//  >>--> DreymaR (OEystein Bech-Aase, formerly Bech Gadmar), 2012-01: Additions to xkb/symbols/no
//  Colemak[eD]: National/locale Colemak "edition DreymaR" variants for Norwegian.
//  2006-01-01  Shai Coleman  http://colemak.com/  (Public Domain)  : The Colemak keyboard layout.
//  See the Big Bag section on Cmk[eD] locales: https://dreymar.colemak.org/variants.html#locales

//  The 'keep local symbols' variant keeps the national symbol and special letter setup.
partial alphanumeric_keys
xkb_symbols "cmk_ed_ks" {
    include "no(basic)"
    include "colemak(cmk_ed_letters)"
    name[Group1]= "Norwegian (Colemak[eD], keep local symbols)";

//  NOTE: Symbols on letter keys may be lost in cmk_ed_ks if they are not on Colemak[eD] letter keys.
//  EuroSign is often on 'E'. The latin(intl) and locale(winkeys) layout variants use '5'.
//  Colemak[eD] has EuroSign on 'E' and mu on '5'.
//    key <AE05> { [ NoSymbol, NoSymbol,       mu, onehalf ] };
//    key <AE05> { [ NoSymbol, NoSymbol, EuroSign, onehalf ] }; // onehalf is moved, permille is lost

    key <AD10>	{ [ oslash, Ooblique, dead_acute, dead_doubleacute ] }; // from <AC10>
};

//  The 'us' variant uses the US-type symbol key setup (recommended!) as it is nearly an intl. standard.
//  For Norwegian, necessary local letters are added to designated flexible spots in the layout.
//  For "writing" and "coding" subvariants, move the brackets between lv1-2 and lv3-4 as shown.
partial alphanumeric_keys
xkb_symbols "cmk_ed_us" {
    include "colemak(cmk_ed_letters)"
    include "symkeys(cmk_ed_symbols)"
    include "level3(ralt_switch)"
    name[Group1]= "Norwegian (Colemak[eD], unified symbols)";

//    key <AD11> { [   bracketleft,     braceleft,               aring,               Aring ] };
//    key <AD12> { [  bracketright,    braceright,                  ae,                  AE ] };
    key <AD11> { [         aring,         Aring,         bracketleft,           braceleft ] }; // from <AD10>
    key <AD12> { [            ae,            AE,        bracketright,          braceright ] }; // from <AC11>
    key <LSGT> { [        oslash,      Ooblique,                  oe,                  OE ] }; // from <AC10>
//  NOTE: The Scandinavian layouts (dk/fi/no/se) have been harmonized. This shouldn't affect typing efficiency.
};
//  <--<< DreymaR: Additions to xkb/symbols/no
