[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Key mapping



I think that is not an OpenBSD feature, this depends on the window
manager your using in your X session.
I like bbkeys (a 'hotkey maker' made for blackbox, but it works in any
other wm as well), try it out.
Dont forget to configure your Xmodmap too.

---
Thats my ~/.Xmodmap file:

clear    shift
clear    lock
clear    control
clear    mod1
clear    mod2
clear    mod3
clear    mod4
clear    mod5

keycode 94 = Shift_L Shift_L
keycode 123 = Shift_R Shift_R
! (e.g., Microsoft's ergonomic keyboard).
keycode 115 = Hyper_L
keycode 116 = Hyper_R
!keycode 117 = Menu
keycode 117 = Multi_key

keycode 78 = Menu
keycode 111 = Sys_Req

! keycode 15 = 6 dead_circumflex
keycode 15 = 6 asciicircum
keycode 22 = BackSpace
keycode 91 = KP_Delete KP_Decimal
! keycode 48 = 0xFE51 dead_diaeresis
keycode 48 = apostrophe quotedbl
! keycode 49 = dead_grave dead_tilde
keycode 49 = grave asciitilde
keycode 107 = Delete
!keycode 111 = X386Mode_Lock
!keycode 66 = Control_L Control_L
keycode 66 = Hyper_L Hyper_R
! keycode 66 = Tab Tab
! Set the modifiers
!
add     shift   = Shift_L Shift_R
! add     lock    = Caps_Lock
add     control = Control_L Control_R
add     mod1    = Alt_L Alt_R
add	mod4	= Hyper_L Hyper_R
! If you have ServerNumlock set in your XF86Config, you can comment out
add     mod2    = Num_Lock
!
!
!
! If you use any of the special default key mappings in Xconfig, they should
be
! duplicated in this file.  Mappings should be added before the section above
! which sets the modifiers.
!
!  For the key specs:
!     LeftAlt     =>  keycode  64
!     RightAlt    =>  keycode 113
!     AltGr       =>  keycode 113
!     ScrollLock  =>  keycode  78
!     RightCtl    =>  keycode 109
!
!  For the mappings:
!     Meta        =>  Alt_L Meta_L
!                     Alt_R Meta_R
!     Compose     =>  Multi_key
!     ModeShift   =>  Mode_switch
!     ModeLock    =>  Mode_switch X386Mode_Lock
!     ScrollLock  =>  Scroll_Lock
!     Control     =>  Control_R
!
!  If you use ModeShift or ModeLock, the following modifier must be set:
!
!add     mod5    = Mode_switch
!
!  For example, to get the equivalent of:
!
!  ScrollLock  ModeLock
!  RightAlt    ModeShift
!  LeftAlt     Meta
!  RightCtl    Compose
!
!  use the following:
!
!keycode  78 = Mode_switch X386Mode_Lock

---
And here goes my ~/.bbkeysrc file:
KeyToGrab(a), WithModifier(Mod4), WithAction(ExecCommand), DoThis(xterm -bg
black -fg white -geometry 94x31)
KeyToGrab(n), WithModifier(Mod4), WithAction(ExecCommand), DoThis(mozilla)
KeyToGrab(n), WithModifier(Mod4+Shift), WithAction(ExecCommand),
DoThis(netscape)
KeyToGrab(l), WithModifier(Mod4), WithAction(ExecCommand), DoThis(xlock -mode
blank)

KeyToGrab(1), WithModifier(Mod4), WithAction(Workspace1)
KeyToGrab(2), WithModifier(Mod4), WithAction(Workspace2)
KeyToGrab(3), WithModifier(Mod4), WithAction(Workspace3)
KeyToGrab(4), WithModifier(Mod4), WithAction(Workspace4)
KeyToGrab(5), WithModifier(Mod4), WithAction(Workspace5)
KeyToGrab(6), WithModifier(Mod4), WithAction(Workspace6)
KeyToGrab(7), WithModifier(Mod4), WithAction(Workspace7)
KeyToGrab(8), WithModifier(Mod4), WithAction(Workspace8)
KeyToGrab(9), WithModifier(Mod4), WithAction(Workspace9)
KeyToGrab(0), WithModifier(Mod4), WithAction(Workspace10)

KeyToGrab(z), WithModifier(Mod4), WithAction(MaximizeWindow)
KeyToGrab(x), WithModifier(Mod4), WithAction(Close)
KeyToGrab(s), WithModifier(Mod4), WithAction(StickWindow)
KeyToGrab(Down), WithModifier(Mod4), WithAction(Lower)
KeyToGrab(Up), WithModifier(Mod4), WithAction(Raise)

KeyToGrab(Tab), WithModifier(Mod4), WithAction(NextWindow)
KeyToGrab(Tab), WithModifier(Mod4+Shift), WithAction(PrevWindow)

KeyToGrab(Left), WithModifier(Mod4), WithAction(NextWorkspace)
KeyToGrab(Right), WithModifier(Mod4), WithAction(PrevWorkspace)
---
This too files, working together, program the useless window key of the
win kbds to do a lot of things basing in its combination with other
keys.

This works well to me in BlackBox, i've never tested this in any other
wm.


Colin Harford (colin.harford@mail.su.ualberta.ca) wrote:
> How would I do keymapping in OpenBSD
>
> ie: setup say f1 to be xlock, f2 to be ssh connect command to a commonly
> used server, etc.
>
>
>
> Colin Harford    
>
>                                       
> Systems and Network Administrator         Apple Product Professional
> =================================     
> Computer and Network Support         
> University of Alberta Students' Union                  
> Phone: (780) 492-4241   Fax:  (780) 492-4643
> http://www.su.ualberta.ca
>
>
> "I sense much NT in you, NT leads to Blue Screen.
> Blue Screen leads to downtime, downtime leads to suffering.
> NT is the path to the darkside."
>          - Unknown Unix Jedi

--
If I could drop dead right now, I'd be the happiest man alive!
		-- Samuel Goldwyn

[demime 0.98d removed an attachment of type application/pgp-signature]