[code] [textadept] Indicator click on OS X

From: Robert Gieseke <rob.g.att.web.de>
Date: Tue, 29 Oct 2013 18:08:06 +0100

Hi,

I'm trying to figure out an indicator click issue on OS X, the following
test code displays Ctrl, Alt and Shift just fine, but not clicks with
Meta (Command). On Linux this displays Ctrl, Alt and Shift correctly as
well. On OS X Meta is not recognized and reported as modifier 0.

keys.c7 = function()
   -- Create test buffer with an indicatr.
   local buffer = buffer.new()
   buffer:add_text('Test 123 456')
   buffer:indicator_fill_range(0, 12)
   buffer:set_save_point()
   -- Display modifiers on click on indicator.
   events.connect(events.INDICATOR_CLICK, function(position, modifiers)
     local band = bit32.band
     local shift = band(buffer.MOD_SHIFT, modifiers) ~= 0
     local ctrl = band(buffer.MOD_CTRL, modifiers) ~= 0
     local alt = band(buffer.MOD_ALT, modifiers) ~= 0
     local meta = band(buffer.MOD_META, modifiers) ~= 0

     msg = 'Modifiers: '..modifiers..' ['
     if shift then msg = msg .. ' shift' end
     if ctrl then msg = msg .. ' control' end
     if alt then msg = msg .. ' alt' end
     if meta then msg = msg .. ' meta' end

     ui.statusbar_text = msg..' ]'
   end)
end

Any pointers?

Thanks in advance,
Robert

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Tue 29 Oct 2013 - 13:08:06 EDT

This archive was generated by hypermail 2.2.0 : Wed 30 Oct 2013 - 06:35:20 EDT