Document Home/End keys for OS X on MacBook

From: vais <vsalik....at.gmail.com>
Date: Sun, 1 Mar 2009 15:06:57 -0800 (PST)

On my MacBook, there are no Home, End, Page Up or Page Down keys. But
there is an fn key, and fn + arrow keys work for everything in TA
except for going to the very beginning and the very end of the entire
buffer.

Currently in TA on OS X:

fn + left goes to the beginning of the line
fn + right goes to the end of the line
fn + up goes one page up
fn + down goes one page down

Here is some code that makes fn + Command + arrow keys to work as home/
end for the entire buffer:

textadept.events.add_handler('keypress', function(code, shift,
control, alt)
  if not alt then return false end
  if code == 65365 or code == 65360 then
    if shift == true then
      buffer:document_start_extend()
    else
      buffer:document_start()
    end
    return true
  elseif code == 65366 or code == 65367 then
    if shift == true then
      buffer:document_end_extend()
    else
      buffer:document_end()
    end
    return true
  end
  return false
end)

I have this code in my key_commands.lua. Hope this helps someone
missing this functionality.
Received on Sun 01 Mar 2009 - 18:06:57 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:37:40 EST