Skip to content

Commit

Permalink
Fix for Norwegian keyboards
Browse files Browse the repository at this point in the history
Added rHermes' AutoHotkey script for Norwegian keyboards
Added a new /bin/misc directory for miscellaneous files like this
  • Loading branch information
linleyh committed Mar 14, 2017
1 parent b09b71d commit b1413df
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 12 deletions.
32 changes: 20 additions & 12 deletions bin/init.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
# Options are:
#
# display_w (value)
# sets display width. Valid values are 1024 to 1920
# Sets display width. Valid values are 1024 to 1920
# display h (value)
# sets height. Valid values are 768 to 1200
# Sets height. Valid values are 768 to 1200
#
# vol_music
# sets music volume. Valid values are 0 to 100
# Sets music volume. Valid values are 0 to 100
# vol_effect (value)
# sets effects volume. Valid values are 0 to 100
# Sets effects volume. Valid values are 0 to 100
#
# fullscreen
# uses a fullscreen window at your current display resolution.
# Uses a fullscreen window at your current display resolution.
# (display_w/h values are ignored). This mode is recommended
# unless you have a good reason not to use it.
# If you are using multiple monitors, it may be useful to set
Expand All @@ -40,32 +40,32 @@ vol_effect 80
# Some more special options are:
#
# true_fullscreen
# uses true fullscreen. May cause problems when a file
# Uses true fullscreen. May cause problems when a file
# dialogue (load/save) is opened. Unlike fullscreen,
# the display_w and h values should be set (to a resolution
# that your monitor supports).
# If you are using multiple monitors, it may be useful to set
# capture_mouse as well (see below).
#
# msaa_off
# turns off multisampled anti-aliasing. Improves performance
# Turns off multisampled anti-aliasing. Improves performance
# at a terrible cost in jaggedness.
#
# background_detail (value)
# reduces the background detail to improve performance.
# Reduces the background detail to improve performance.
# values are:
# 0 turns off the background completely (other than data wells). This
# is fast, but doesn't look so great.
# 1 reduces detail a bit.
#
# capture_mouse
# for playing in fullscreen/true_fullscreen with a multi-monitor setup.
# For playing in fullscreen/true_fullscreen with a multi-monitor setup.
# tries to capture the mouse in the game window.
#


# template
# tells the game to automatically load a file into a template on start-up.
# Tells the game to automatically load a file into a template on start-up.
# example:
#
# template 0 src/cm_base.c
Expand Down Expand Up @@ -115,6 +115,11 @@ template 0 proc/cm_tri_base.c
# - you should be able to ignore this part if you're using
# a standard QWERTY keyboard
# - but this may help if the game isn't registering cursor keys etc
# - Github user rHermes reports that unicode input does not work correctly
# for some keys on a Norwegian keyboard - the [] and () keys - and has
# written an AutoHotkey script to fix this (tested on Windows so far).
# See fix-altgr.ahk in the /bin/misc directory.
#
#
# To remap a key, use a line like this:
# keymap 2 47
Expand Down Expand Up @@ -149,9 +154,9 @@ template 0 proc/cm_tri_base.c
# 23 F9
# 24 F10

# remapping the following number keys only affects keyboard shortcuts for building
# Remapping the following number keys only affects keyboard shortcuts for building
# (which by default use the number keys on a QWERTY keyboard)
# it doesn't affect the way number keys work in text input.
# It doesn't affect the way number keys work in text input.
# 25 build template 0
# 26 build template 1
# 27 build template 2
Expand Down Expand Up @@ -180,4 +185,7 @@ template 0 proc/cm_tri_base.c
# Currently, a remapped function can only have a single key mapped to it (which prevents
# the use of both shift keys, for example). This may be fixed in future.




# last line (leave this here)
46 changes: 46 additions & 0 deletions bin/misc/fix-altgr.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
; Created by rHermes (2017.03.14 12:36:40 UTC)
;
; This was made so that I could use the ingame code editor in the very cool
; game called "liberation-circut"[1]. It has only been minimally tested so
; please fork and share your improvements!
;
; [1] - [https://github.com/linleyh/liberation-circuit]

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; ^!r::Reload ; QoL keybinding. Uncomment if you want to have access to quick reloads.

RD := false

; This sends the keys neccecary.
KeyPipeLine(agr,shi,nor) {
global RD
if (RD) {
Send %agr%
} else if (GetKeyState("Shift")) {
Send %shi%
} else {
Send %nor%
}
}

#IfWinActive ahk_exe LibCirc.exe
; These two are responsible for toggeling RD on and off.
*RAlt:: RD := true
*RAlt Up:: RD := false

*2::KeyPipeLine("@", """", "2") ; 2 aka @
*3::KeyPipeLine("£", "{#}", "3") ; 3 aka £ - NP: The editor has no support for £ in the code
*4::KeyPipeLine("$", "¤", "4") ; 4 aka $ - NP: The editor has no support for ¤ in the code

*7::KeyPipeLine("{{}", "/", "7") ; 7 aka {
*8::KeyPipeLine("[", "(", "8") ; 8 aka [
*9::KeyPipeLine("]", ")", "9") ; 9 aka ]
*0::KeyPipeLine("{}}", "=", "0") ; 0 aka }

*\::KeyPipeLine("´", "``", "\") ; \ aka ´ - NP: The editor has no support for ´ or ` in the code
::KeyPipeLine("~", "{^}", "¨") ; ¨ aka ~ - NP: The editor has no support for ¨ in the code
#IfWinActive

0 comments on commit b1413df

Please sign in to comment.